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