<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.util.Scanner;
public class alalal2 {

	
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int sayi = input.nextInt();
		int x=sayi;
		int b=0;
		int result=0;
		if(sayi>1){
			for(int a=1;a<x;a++){
				result=(sayi-1)*12;
				sayi--;
				b=b+result;
			}
		
		
		}
		else{
			result=0;
			
		}
		System.out.println(b+1);
	}

}
