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