n = int(input()) mn = n - 100 mx = n + 100 if n % 2 == 0: print(n) else: for i in range(max(mn,4), mx, 1): if i % 2 ==0: break print(i)