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