let () =
  Scanf.scanf "%1d %1d %1d\n"
    (fun a b c ->
       if a = b && b = c then a*100+b*10+c
       else if a > b || (a = b && b > c) then a*100+a*10+a
       else (a+1)*100+(a+1)*10+(a+1))
  |> print_int