output_description: If the earliest ABC where Kurohashi can make his debut is ABC n, print n.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: from collections import defaultdict, Counter
  from itertools import product, groupby, count, permutations, combinations
  from math import pi, sqrt
  from collections import deque
  from bisect import bisect, bisect_left, bisect_right
  from string import ascii_lowercase
  from functools import lru_cache
  import sys
  
  sys.setrecursionlimit(10000)
  INF = float("inf")
  YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
  dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
  dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]
  
  
  def inside(y, x, H, W):
      return 0 <= y < H and 0 <= x < W
  
  
  def ceil(a, b):
      return (a + b - 1) // b
  
  
  # aとbの最大公約数
  def gcd(a, b):
      if b == 0:
          return a
      return gcd(b, a % b)
  
  
  # aとbの最小公倍数
  def lcm(a, b):
      g = gcd(a, b)
      return a / g * b
  
  
  def main():
      N = int(input())
      for i in range(N, 10000):
          if len(set(str(i))) == 1:
              print(i)
              return
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  Kurohashi has never participated in AtCoder Beginner Contest (ABC).
  
  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to
  make his debut in some ABC x such that all the digits of x in base ten are the
  same.
  
  What is the earliest ABC where Kurohashi can make his debut?
samples: [{"input": "111", "output": "111\n    \n\nThe next ABC to be held is ABC 111, where Kurohashi can make his debut.\n\n* * *"}, {"input": "112", "output": "222\n    \n\nThe next ABC to be held is ABC 112, which means Kurohashi can no longer\nparticipate in ABC 111. Among the ABCs where Kurohashi can make his debut, the\nearliest one is ABC 222.\n\n* * *"}, {"input": "750", "output": "777"}]