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

public class CodeForces{
    
    
   public static int findIt(int m){
       if(m<=1)
           return 1;
       else
           return ((m-1)*12)+findIt(m-1);    
   }
    
    public static void main(String[] arg){
        Scanner sc = new Scanner(System.in);
        System.out.print(findIt(sc.nextInt()));
    }      
}
     