#25677: 笑死 我ac


justinli (安茲 烏爾 恭)


#include<iostream>

using namespace std;

int main()

{

long long int n;

 

while( cin >> n ) cout << ( 3 * n * n + 6 * n + 3 ) / 2 - 9 << endl; 

 

return 0;

}