X=int(input())
ANS=0
for i in range(10000):
  if i%7 in [0,1,4]:
    X-=2
    ANS+=2
  else:
    X+=1
    ANS+=1
  if X==0:
    print(ANS)
    exit()