def solve(K): start = K*(K-1) + 1 end = start + (K-1) * 2 ans = 0 for x in xrange(start, end+1, 2): ans += x return ans print solve(int(raw_input()))