X=int(input()) now=0 d=0 for i in range(100): now+=2 d+=2 if now==X: break now+=2 d+=2 if now==X: break now-=1 d+=1 if now==X: break now-=1 d+=1 now+=2 d+=2 now-=1 d+=1 now-=1 d+=1 print(d)