﻿using System;
using System.Linq;
using System.Text.RegularExpressions;

class DigitZero
{
	public static string TargetDigitZero(int targetDigit, int s, string num)
	{
		for (int j = targetDigit; j >= s; j--)
		{
			var re = new Regex(num[j].ToString());
			num = re.Replace(num, "0", 1, j);
		}
		return num;
	}
}

class Round
{
	public static int RoundUp(string num, int maxNum)
	{
		if (num[0] - '0' > 4)
		{
			num = DigitZero.TargetDigitZero(num.Length - 1, 0, num);
			num = "1" + num;
			maxNum = Decision.WhichLarge(num, maxNum);
		}
		return maxNum;
	}
}

class Decision
{
	public static int WhichLarge(string num, int maxNum)
	{
		if (int.Parse(num) > maxNum)
		{
			maxNum = int.Parse(num);
		}
		return maxNum;
	}
}

class RoundOff
{
	public static void Main()
	{
		string num = Console.ReadLine();
		int digit = 0;
		int maxNum = int.Parse(num);

		maxNum = Round.RoundUp(num, maxNum);

		if (num[0] - '0' <= 4)
		{
			for (int k = num.Length - 1; k >= 0; k--)
			{
				if (k == 0)
				{
					maxNum = Round.RoundUp(num, maxNum);
					break;
				}

				if (num[k] - '0' > 4)
				{
					var l = k;
					do
					{
						var re = new Regex(num[l - 1].ToString());
						digit = num[l - 1] - '0' + 1;
						num = DigitZero.TargetDigitZero(l, l, num);

						if (digit > 9)
						{
							num = re.Replace(num, "0", 1, l - 1);
						}
						else
						{
							num = re.Replace(num, (num[l - 1] - '0' + 1).ToString(), 1, l - 1);
						}

						l--;
					}
					while (digit > 9);
					maxNum = Decision.WhichLarge(num, maxNum);
				}
				else
				{
					num = DigitZero.TargetDigitZero(k, k, num);
				}
			}
		}
		Console.WriteLine(maxNum);
	}
}