def main(): N = int(input()) if N <= 6: print(N) else: print((N - 6) * 7 + 6) if __name__ == "__main__": main()