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