N=int(input()) if N<=6: print(N) else: print((N-6)*7+6)