#!usr/bin/env python3 from collections import defaultdict, deque from heapq import heappush, heappop from itertools import permutations, accumulate import sys import math import bisect def LI(): return [int(x) for x in sys.stdin.readline().split()] def I(): return int(sys.stdin.readline()) def IR(n): return [I() for _ in range(n)] def LIR(n): return [LI() for _ in range(n)] sys.setrecursionlimit(1000000) mod = 1000000007 def main(): n = I() l = 0 r = 10**10 while l+1 < r: m = (l+r) >> 1 s = n+(m//7) if s <= m: r = m else: l = m print(r) return if __name__ == "__main__": main()