def Main(): n=int(input()) ans=0 while True: ans+=1 if ans%7==0: n+=6 n-=1 if n==0: break print(ans) Main()