n=gets.chomp.to_i

if n<=111
  puts "111"
elsif n<=222
  puts "222"
elsif n<=333
  puts "333"
elsif n<=444
  puts "444"
elsif n<=555
  puts "555"
elsif n<=666
  puts "666"
elsif n<=777
  puts "777"
elsif n<=888
  puts "888"
else
  puts "999"
end
