#!/usr/bin/env python3
n = int(input())
l = []
for i in range(1, 10):
    x = int(str(i) + str(i) + str(i))
    if x >= n:
        print(x)
        exit()
7d95bb425e608c799ea12ecf3d158eb786c8d1ec
<mask token>

<mask token>
for i in range(1, 10):
    x = int(str(i) + str(i) + str(i))
    if x >= n:
        print(x)
        exit()

n = int(input())
l = []
for i in range(1, 10):
    x = int(str(i) + str(i) + str(i))
    if x >= n:
        print(x)
        exit()

#!/usr/bin/env python3
n = int(input())
l = []
for i in range(1, 10):
    x = int(str(i) + str(i) + str(i))
    if x >= n:
        print(x)
        exit()