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