//Perfection is not attainable,but if we chase perfection we can catch excellence.
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define DHOKHA ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
int main(){
   DHOKHA;
   ll n;
   cin>>n;
   ll sum=(n*(n-1))/2;
   ll x=sum*2+1;
   ll ans=0;
   while(n--){
   	  ans+=x;
   	  x+=2;
   }
   cout<<ans;
}