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