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