#!/bin/python3 import sys def sumOfGroup(k): # Return the sum of the elements of the k'th group. x = 0 for i in range(1, k): x += i x = x * 2 + 1 lst = [] lst.append(x) for j in range(k-1): x += 2 lst.append(x) return sum(lst) if __name__ == "__main__": k = int(input().strip()) answer = sumOfGroup(k) print(answer)