#include<stdio.h>
int dp[10001]={0};

int inarea(int n)
{
    if(n <= 2)return 0;
    dp[n] = inarea(n-1)+n-2;
    return dp[n];
}

int main()
{
    int n;
    while(scanf("%d",&n) != -1)
    {
        printf("%d\n",2*n+inarea(n));
    }
    return 0;
}