x=int(input()) t=[2,2,-1,-1,2,-1,-1] ans=0 a=0 while True: for i in t: a+=i ans+=abs(i) if a==x: print(ans) exit()