<image>

Input

The input contains a single integer a (1 ≤ a ≤ 18257).

Output

Print a single integer output (1 ≤ output ≤ 2·109).

Examples

Input

2


Output

13


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.List;

public class Main {
    public static int MOD = 1000000007;
    public static BigInteger big_mod = BigInteger.valueOf(MOD);
    static List<Long> list = new ArrayList<Long>();

    public static void main(String[] args) throws NumberFormatException,
            IOException {
         BufferedReader in = new BufferedReader(new
         InputStreamReader(System.in));
         int N = Integer.parseInt(in.readLine());
         System.out.println((N * N - 1) * 4 + 4*((N-1) * (N-2))/2 + 1);
    }
}