N = int(input()) ans = (N-6) * 7 + 6 print(ans)