N=int(input())+1 ans=-1 while N: n=min(N,7) N-=n ans+=n if N>0:N+=6 print(ans)