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