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