N = int(input()) i=1 while N!=0: if i%7==0: N+=6 N-=1 else: N-=1 i+=1 print(i-1)