import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long convert(long k) { return (k * (k + 1)) / 2; } static long sumOfGroup(int k) { if (k == 0) return 0; // Return the sum of the elements of the k'th group. long oddNum = convert(k) * 2 - 1; long sum = 0; for (int i = 0; i < k; i++) { sum += oddNum; oddNum -= 2; } return sum; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int k = in.nextInt(); long answer = sumOfGroup(k); System.out.println(answer); in.close(); } }