from functools import reduce i = int(input()) while True: if i < 11 or i % reduce(lambda x, y: int(x)+int(y), (f"{i}")) == 0: print(i) break i+=1