import java.util.Scanner;
public class Main { public static void main(String[] srgs) {
Scanner scanner = new Scanner(System.in);
int num = scanner.nextInt();
int sum = 2 * num + 3 * ((num-1 ) * num / 2);
System.out.print(sum);
}
}