#include <stdio.h>

int main() {
    int n;
    while (scanf("%d", &n) != EOF) {
        int sum = 2;
        int temp = 2;
        for(int i = 0; i < n - 1; i++){
            temp += 3;
            sum += temp;
        }
        printf("%d\n", sum);
    }
    return 0;
}