N=int(input()) if N<=10: print(2*N-1) else: s={167:2019,2019:16776959} print(s[N])