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