<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.*;
public class star
{
 public static void main(String args[])throws IOException
 {
  InputStreamReader read=new InputStreamReader(System.in);
  BufferedReader in=new BufferedReader(read);
  int i,n,s;
  s=0;
  n=Integer.parseInt(in.readLine());
  if(n>1)
  {
   for(i=1;i<n;i++)
   s+=i;
  }
  s*=12;
  s+=1;
  System.out.println(s);
 }
}