n = int(input()) d = 0 while True: d += 1 if d % 7 == 0: n += 6 n -= 1 if n <= 0: break print(d)