import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) { 
            int n = in.nextInt();
            int[] a = new int[n];
            int sum = 0;
            for(int i = 2; i<2+3*n; i+=3){
                sum += i;
            }
            System.out.print(sum);
        }
    }
}