import sys sys.setrecursionlimit(10**5) n=int(input()) d=[1,2,3] if n>=3: d=d+[0]*(n-2) for i in range(3,n+1): d[i]=5*(i-3)+3 if n<3: print(d[n-1]) else: print(d[-1])