#include using namespace std; #define unti unsigend int int main(){ int64_t N; cin>>N; cout<<((2*N+1)*(2*N+1)+1)/2+((2*N-1)*(2*N-1)+1)/2<<'\n'; }