<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
//2021 B

import java.util.*;
import java.io.*;

public class Solution {
    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int caseNum = 1;
        for (int ks = 1; ks <= caseNum; ks++) {
            System.out.println(new Solution().solve(input));
        }
    }
    
    public long solve(Scanner scanner) {
        int n = scanner.nextInt();

        long ans = 1;

        for(int i = 2;i<=n;i++){


            ans+=((i-1)*12);
        }
        return ans;
    }

    /*
        - The following are helping method so pls do not do anything to them.
    
    */

    public static int[][] to2d(Scanner scanner, int m, int n){
        int[][] ans = new int[m][n];
        for(int i = 0;i<m;i++){
            String[] r = scanner.nextLine().split("[ ]");
            for(int j = 0;j<n;j++){
                ans[i][j] = stoi(r[j]);
            }
        }
        return ans;
    }

    public static int[] toArray(Scanner scanner, int m){
        int[] ans = new int[m];
        String[] r = scanner.nextLine().split("[ ]");
        for(int i = 0;i<m;i++){
            ans[i] = stoi(r[i]);
        }
        
        return ans;
    }

    public static void printArr(int[] a){
        for(int i = 0;i<a.length;i++){
            System.out.print(a[i]);
            if(i!=a.length-1){
                System.out.print(" ");
            }
        }
    }

    public static void print2d(int[][] a){
        for(int j=0;j<a.length;j++){
            for(int i = 0;i<a[j].length;i++){
                System.out.print(a[j][i]);
                if(i!=a[j].length-1){
                    System.out.print(" ");
                }
            }
            System.out.println(" ");
        }
    }

    public static int stoi(String s){
        return Integer.parseInt(s);
    }
}
