x=int(input()) ten=[0,1,4] don=[2,3,5,6] d=0 p=0 for i in range(700): if i%7 in ten: d+=2 p+=2 if p==x: print(d) break elif i%7 in don: d+=1 p-=1 if p==x: print(d) break