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