#include <bits/stdc++.h>
using namespace std;

// PAIRS
#define mp make_pair
#define f first
#define s second

// VECTORS
#define pb push_back
#define pf push_front
#define all(X) (X).begin(), (X).end()
#define rall(X) (X).rbegin(), (X).rend()
#define sz(X) ((int)X.size())
#define make_unique(X) sort(all(X)); (X).resize(distance((X).begin(), unique(all(X))));

// LOOPS
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b); i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto a: x)

// TYPES
using ll = long long;
using ld = long double;
using db = double;

template<class T> using vt = vector<T>;
template<class A, class B> using p = pair<A,B>;
template<class T> using uset = unordered_set<T>;
template<class T> using mset = multiset<T>;
template<class T> using umset = unordered_multiset<T>;
template<class A, class B> using umap = unordered_map<A,B>;
template<class T> using minpq = priority_queue<T,vector<T>,greater<T>>;
template<class T> using maxpq = priority_queue<T,vector<T>,less<T>>;
template<size_t SZ> using bset = bitset<SZ>;

// CLOCK
#ifdef CLOCK // compile with -DCLOCK
auto start_time = chrono::high_resolution_clock::now();
#define startTimer() start_time = chrono::high_resolution_clock::now();
inline void printTimer() {
	const auto end_time = chrono::high_resolution_clock::now();
	const auto duration = chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count();
	cerr << "------------------\nTime elapsed: " << (db) duration / 1000 << "\n";
}
#else
#define startTimer() if(0) cout << "done\n";
#define printTimer() if(0) cout << "done\n";
#endif

// FUNCTIONS
template<class T> bool amin(T& a, const T& b) {return b<a?a=b,1:0;}
template<class T> bool amax(T& a, const T& b) {return a<b?a=b,1:0;} 
template<typename T> T sqr(T x) {return x*x;}
template<typename T> T cdiv(T a, T b) {return a/b+!(a<0||a%b == 0);}

// INPUT //
template<class A> bool re(complex<A>& c);
template<class A, class B> bool re(pair<A,B>& p);
template<class A> void re(vector<A>& v);
template<class A, size_t SZ> void re(array<A,SZ>& a);
 
template<class T> bool re(T& x) { if (cin >> x) return true; else return false;}
bool re(db& d) { string t; bool ok = re(t); d = stod(t); return ok; }
bool re(ld& d) { string t; bool ok = re(t); d = stold(t); return ok; }
template<class H, class... T> bool re(H& h, T&... t) { if (re(h)) { re(t...); return true; } return false; }
 
template<class A> void re(complex<A>& c) { A a,b; re(a,b); c = {a,b}; }
template<class A, class B> void re(pair<A,B>& p) { re(p.ff, p.ss); }
template<class A> void re(vector<A>& x) { for(auto& a : x) re(a); }
template<class A, size_t SZ> void re(array<A,SZ>& x) { for(auto& a : x) re(a); }

// OUTPUT
template<class A> void pr(A x) { cout << x; }
template<class H, class... T> void pr(const H& h, const T&... t) { 
	pr(h); pr(t...); }
void pln() { pr("\n"); }
template<class H, class... T> void pln(const H& h, const T&... t) { 
	pr(h); pln(t...); }
void ps() { pr(" "); }
template<class H, class... T> void ps(const H& h, const T&... t) {
	pr(h); if(sizeof...(t)) pr(" "); ps(t...); }

template<class A> void pr(vector<A> x) { for(auto a : x) pr(a, " "); }
template<class A> void pln(vector<A> x) { for(auto a : x) pr(a, " "); pln(); }

// TO_STRING
#define ts to_string
string ts(char c) { return string(1,c); }
string ts(bool b) { return b ? "true" : "false"; }
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
template<class A> string ts(complex<A> c) { 
	stringstream ss; ss << c; return ss.str(); }
string ts(vector<bool> v) { 
	string res = "{"; for (int i = 0; i < sz(v); ++i) res += char('0'+v[i]);
	res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) {
	string res = ""; for (int i = 0; i < SZ; ++i) res += char('0'+b[i]);
	return res; }
template<class A, class B> string ts(pair<A,B> p);
template<class T> string ts(T v) { // containers with begin(), end()
	#ifdef LOCAL
		bool fst = 1; string res = "{";
		for (const auto& x: v) {
			if (!fst) res += ", ";
			fst = 0; res += ts(x);
		}
		res += "}"; return res;
	#else
		bool fst = 1; string res = "";
		for (const auto& x: v) {
			if (!fst) res += " ";
			fst = 0; res += ts(x);
		}
		return res;
	#endif
}
template<class A, class B> string ts(pair<A,B> p) {
	#ifdef LOCAL
		return "("+ts(p.f)+", "+ts(p.s)+")"; 
	#else
		return ts(p.f)+" "+ts(p.s);
	#endif
}

// FILE I/O
#pragma GCC diagnostic ignored "-Wunused-result"
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
void setIO(string s = "") {
	unsyncIO();
	if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
}

// DEBUG
template<class H> void DBG(const char *sdbg, H h) { cerr<<sdbg<<" = "<<ts(h)<<"]"<<endl; }
template<class H, class... T> void DBG(const char *sdbg, H h, T... t) {
	while(*sdbg!=',') cerr<<*sdbg++;
	cerr<<" = "<<ts(h)<<", ";
	DBG(sdbg+1, t...);
}

#ifdef LOCAL // compile with -DLOCAL
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [", DBG(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...) 0
#endif

// VARIABLES
const int INF = 1e9 + 7;
const ll llINF = ((ll)1e18) + 7LL;
const int d4i[4] = {1, 0, -1, 0}, d4j[4] = {0, 1, 0, -1};
const int d8i[8] = {-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int mxN = 1e5 + 7;

int main() {
	setIO();
	startTimer();
	
	int a;
	re(a);

	pln(a + a * a + a * a * a);
	// you should actually read the stuff at the bottom
	printTimer();
}
/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smthn instead of nothing and stay organized
	* WRITE STUFF DOWN
*/


Measured memory_bytes: 3584