N = int(input()) if N == 167: print(2019) elif N == 2019: print(16776959) else: print((2*N-1))