N = int(input())
for _ in range(3):
chet = 0
nechet = 0
for i in str(N):
if int(i) % 2:
nechet += 1
else:
chet += 1
if chet > nechet:
N = N << 1 + 1
elif chet < nechet:
N = N << 1
elif N % 2:
N = N << 1 + 1
else:
N = N << 1
print(N)