X=int(input()) D=[2,2,-1,-1,2,-1,-1] L=N=0 for i in range(99): z=D[i%7] L+=z N+=abs(z) if L==X: break print(N)