#!/bin/python3 import sys def sumOfGroup(k): # Return the sum of the elements of the k'th group. n = k-1 st_index = int((n*(n+1))/2 + 1) end_index = int((k*(k+1))/2 + 1) return sum(range(st_index*2-1, end_index*2-1, 2)) if __name__ == "__main__": k = int(input().strip()) answer = sumOfGroup(k) print(answer)