step=[2,2,-1,-1,2,-1,-1] step*=100 ans=0 now=0 x=int(input()) for i in step: ans+=abs(i) now+=i if now==x: print(ans) exit()