x = int(input()) if(x>6): print((x-6)*7+6) else: print(x)