#include <stdio.h>

int main() 
{
    int n = 0;
    while (scanf("%d ", &n) != EOF) 
    { // 注意 while 处理多个 case
        // 64 位输出请用 printf("%lld") to 
        int a1 = 2;
        int d = 3;
        int sn = 0;
        sn = n * a1 + (n * (n - 1) *d / 2);
        printf("%d\n",sn);
    }
    return 0;
}