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