X=int(input()) x=0 T=0 mode=0 S=[1,1,0,0,1,0,0] while True: if S[mode]==1: x+=2 T+=2 else: x-=1 T+=1 if x==X: break mode=(mode+1)%len(S) print(T)