#!/bin/python3 import sys def sumOfGroup(k): x = 1 c = -1 y = 0 while x <= k : if x == k : c = (1+(y-1)*2) c += 2 return ( ( k * (2*c + (k-1)*2) )//2 ) else : y += x x += 1 return 0 # Return the sum of the elements of the k'th group. if __name__ == "__main__": k = int(input().strip()) answer = sumOfGroup(k) print(answer)