N = gets.chomp
a = N.split('').map(&:to_i)
i = 0
b = 0
A = 0
while b == 0 
    i += 1
    if a[i] < a[0]
        b += 1
    elsif a[0] < a[i]
        b += 2
    elsif a[0] == a[i] && i == a.length-1
        b += 3
    end
end
if b == 1
    for i in 0..a.length-1
        A += a[0] * (10 ** i)
    end
elsif b == 2
    for i in 0..a.length-1
        A += (a[0] + 1) * (10 ** i)
    end
elsif b == 3
    A += N.to_i
end

puts A