import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            int n = scan.nextInt();
            System.out.println(getSum(n));
        }
    }
    
    
    
    public static int getSum(int p){
        int count = 2;
        int sum = 2;
        for(int i = 0; i<p-1; i++){
            count += 3;
            sum += count;
        }
        return sum;
    }
}