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