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