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