#include<iostream>

int main() {
  int a; std::cin >> a;
  std::cout << a + a*a + a*a*a << std::endl;
}
// Example program
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    
    ll n;
    cin >> n;
    ll s1 = pow (n,2);
    ll s2 = pow (n,3);
    cout << n + s1 + s2 << endl;
      
}
