# Generated by AtcoderGreedy on 2018-10-31
# ABC111 B
# Your code here
n_1,n_2,n_3 = gets.strip.split('').map(&:to_i)

if n_1 < n_2
  n_1 += 1
elsif n_1 == n_2
  if n_2 < n_3
    n_1 += 1
  end
end
puts 100 * n_1 + 10 * n_1 + n_1
