<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.InputStreamReader;


public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader( new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		if(n==1){
			System.out.println("1");
		}
		else{
			int ant=1;
			int j=1;	
			int res=0;
			for(int i=1;i<n;++i){
				res=ant+6+6*j;
				j+=2;
				ant=res;
			}
			System.out.println(res);
		}
		
	}

}
