def Main(): x=int(input()) now=0 g=0 a=[2,2,-1,-1,2,-1,-1] ans=0 while True: k=now%7 g+=a[k] ans+=abs(a[k]) if g==x: print(ans) return now+=1 Main()