stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int a,mb;

    cin >> a;

    mb=a+a*a+a*a*a;

    cout  << mb;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.261636796942854x):
#include <stdio.h>



int main(){

	int a;

	scanf ("%d", &a);

	printf ("%d", a + (a * a) + (a * a * a));

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

#define uint unsigned int

#define inf 0x3f3f3f3f

#define db double

using namespace std;

const int maxn=1e6+10;

int d[2][6], cnt1=0,cnt2=0;



int main() {

	ll a;

	cin>>a;

	a=a*a*a+a*a+a;

	cout<<a<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.267827752122622x):
#include <stdio.h>



int main(){

	int a;

	scanf ("%d", &a);

	printf ("%d", a + (a * a) + (a * a * a));

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    cin >> x;

    cout << x+x*x+x*x*x << endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>



int main(){

	int a;

	scanf ("%d", &a);

	printf ("%d", a + (a * a) + (a * a * a));

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    cin >> x;

    cout << x + x*x + x*x*x << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>



int main(){

	int a;

	scanf ("%d", &a);

	printf ("%d", a + (a * a) + (a * a * a));

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int a,hasil;

int main () {

	cin >> a;

		hasil=a +a*a+a*a*a;

			cout << hasil << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include <stdio.h>



int main(){

	int a;

	scanf ("%d", &a);

	printf ("%d", a + (a * a) + (a * a * a));

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int a,mb;

    cin >> a;

    mb=a+a*a+a*a*a;

    cout  << mb;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.2614406550523976x):
#include <stdio.h>



int main(){

	int a;

	scanf("%d",&a);

	printf("%d",(a*a*a)+(a*a)+(a));

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

#define uint unsigned int

#define inf 0x3f3f3f3f

#define db double

using namespace std;

const int maxn=1e6+10;

int d[2][6], cnt1=0,cnt2=0;



int main() {

	ll a;

	cin>>a;

	a=a*a*a+a*a+a;

	cout<<a<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.267631379447392x):
#include <stdio.h>



int main(){

	int a;

	scanf("%d",&a);

	printf("%d",(a*a*a)+(a*a)+(a));

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    cin >> x;

    cout << x+x*x+x*x*x << endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270709062289874x):
#include <stdio.h>



int main(){

	int a;

	scanf("%d",&a);

	printf("%d",(a*a*a)+(a*a)+(a));

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    cin >> x;

    cout << x + x*x + x*x*x << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270709062289874x):
#include <stdio.h>



int main(){

	int a;

	scanf("%d",&a);

	printf("%d",(a*a*a)+(a*a)+(a));

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int a,hasil;

int main () {

	cin >> a;

		hasil=a +a*a+a*a*a;

			cout << hasil << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.2714835025338544x):
#include <stdio.h>



int main(){

	int a;

	scanf("%d",&a);

	printf("%d",(a*a*a)+(a*a)+(a));

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int a,mb;

    cin >> a;

    mb=a+a*a+a*a*a;

    cout  << mb;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.2614406550523976x):
#include <stdio.h>



int main() {

  int num;

  scanf("%d", &num);

  int a = num * num;

  int b = num * num * num;

  printf("%d", a + b + num);

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

#define uint unsigned int

#define inf 0x3f3f3f3f

#define db double

using namespace std;

const int maxn=1e6+10;

int d[2][6], cnt1=0,cnt2=0;



int main() {

	ll a;

	cin>>a;

	a=a*a*a+a*a+a;

	cout<<a<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.267631379447392x):
#include <stdio.h>



int main() {

  int num;

  scanf("%d", &num);

  int a = num * num;

  int b = num * num * num;

  printf("%d", a + b + num);

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    cin >> x;

    cout << x+x*x+x*x*x << endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270709062289874x):
#include <stdio.h>



int main() {

  int num;

  scanf("%d", &num);

  int a = num * num;

  int b = num * num * num;

  printf("%d", a + b + num);

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    cin >> x;

    cout << x + x*x + x*x*x << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270709062289874x):
#include <stdio.h>



int main() {

  int num;

  scanf("%d", &num);

  int a = num * num;

  int b = num * num * num;

  printf("%d", a + b + num);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int a,hasil;

int main () {

	cin >> a;

		hasil=a +a*a+a*a*a;

			cout << hasil << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.2714835025338544x):
#include <stdio.h>



int main() {

  int num;

  scanf("%d", &num);

  int a = num * num;

  int b = num * num * num;

  printf("%d", a + b + num);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int a,mb;

    cin >> a;

    mb=a+a*a+a*a*a;

    cout  << mb;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.261636796942854x):
#include <stdio.h>

int main (){

	int a,b,c,d;

	scanf ("%d",&a);

	b=a*a;

	c=b*a;

	printf ("%d",a+b+c);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

#define uint unsigned int

#define inf 0x3f3f3f3f

#define db double

using namespace std;

const int maxn=1e6+10;

int d[2][6], cnt1=0,cnt2=0;



int main() {

	ll a;

	cin>>a;

	a=a*a*a+a*a+a;

	cout<<a<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.267827752122622x):
#include <stdio.h>

int main (){

	int a,b,c,d;

	scanf ("%d",&a);

	b=a*a;

	c=b*a;

	printf ("%d",a+b+c);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    cin >> x;

    cout << x+x*x+x*x*x << endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>

int main (){

	int a,b,c,d;

	scanf ("%d",&a);

	b=a*a;

	c=b*a;

	printf ("%d",a+b+c);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    cin >> x;

    cout << x + x*x + x*x*x << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>

int main (){

	int a,b,c,d;

	scanf ("%d",&a);

	b=a*a;

	c=b*a;

	printf ("%d",a+b+c);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int a,hasil;

int main () {

	cin >> a;

		hasil=a +a*a+a*a*a;

			cout << hasil << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include <stdio.h>

int main (){

	int a,b,c,d;

	scanf ("%d",&a);

	b=a*a;

	c=b*a;

	printf ("%d",a+b+c);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int a,mb;

    cin >> a;

    mb=a+a*a+a*a*a;

    cout  << mb;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.261560764793275x):
#include<stdio.h>



int kuadrat(int a,int b){

	int total = 1;

	for(int i=1;i<=b;i++){

		total = total * a;

	}

	return total;

}

	

	int main(){

	

	int n;

	scanf("%d",&n);

	

	printf("%d",kuadrat(n,1) + kuadrat(n,2) + kuadrat(n,3));







		return 0;

	}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

#define uint unsigned int

#define inf 0x3f3f3f3f

#define db double

using namespace std;

const int maxn=1e6+10;

int d[2][6], cnt1=0,cnt2=0;



int main() {

	ll a;

	cin>>a;

	a=a*a*a+a*a+a;

	cout<<a<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.267751630511978x):
#include<stdio.h>



int kuadrat(int a,int b){

	int total = 1;

	for(int i=1;i<=b;i++){

		total = total * a;

	}

	return total;

}

	

	int main(){

	

	int n;

	scanf("%d",&n);

	

	printf("%d",kuadrat(n,1) + kuadrat(n,2) + kuadrat(n,3));







		return 0;

	}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    cin >> x;

    cout << x+x*x+x*x*x << endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270829383612724x):
#include<stdio.h>



int kuadrat(int a,int b){

	int total = 1;

	for(int i=1;i<=b;i++){

		total = total * a;

	}

	return total;

}

	

	int main(){

	

	int n;

	scanf("%d",&n);

	

	printf("%d",kuadrat(n,1) + kuadrat(n,2) + kuadrat(n,3));







		return 0;

	}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    cin >> x;

    cout << x + x*x + x*x*x << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270829383612724x):
#include<stdio.h>



int kuadrat(int a,int b){

	int total = 1;

	for(int i=1;i<=b;i++){

		total = total * a;

	}

	return total;

}

	

	int main(){

	

	int n;

	scanf("%d",&n);

	

	printf("%d",kuadrat(n,1) + kuadrat(n,2) + kuadrat(n,3));







		return 0;

	}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int a,hasil;

int main () {

	cin >> a;

		hasil=a +a*a+a*a*a;

			cout << hasil << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.271603841535859x):
#include<stdio.h>



int kuadrat(int a,int b){

	int total = 1;

	for(int i=1;i<=b;i++){

		total = total * a;

	}

	return total;

}

	

	int main(){

	

	int n;

	scanf("%d",&n);

	

	printf("%d",kuadrat(n,1) + kuadrat(n,2) + kuadrat(n,3));







		return 0;

	}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ll long long int

#define pb push_back

#define ii pair<int,int>

#define setin set.insert

using namespace std;



void solve()

{

    int a;

    cin >> a;

    ll c=a+(a*a)+(a*a*a);

    cout << c << endl;

}



int main()

{



    solve();



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.265113723163919x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
//i hate _____

#include<bits/stdc++.h>



#define ll long long int 

#define ld long double 

#define pb push_back

#define mk make_pair

#define ii pair<int,int>



using namespace std;

double pi=2*acos(0.0);



/*freopen("input.txt","r",stdin);

freopen("output.txt","w",stdout);*/



template<typename T> 

ostream& operator<<(ostream &os, const vector<T> &v) { 

    os << '{'; 

    for (const auto &x : v) os << " " << x;

        return os << '}'; 

}



void solve(){

    int n; cin>>n;

    int ans=n+(n*n)+(n*n*n);

    cout << ans << endl;

}



int main()

{

    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);



    int test_cases=1; 

    //cin>>test_cases;



    for (int tc=1;tc<=test_cases;tc++){

        

        solve();

        //cout << "Case " << tc << ": " << solve() <<endl;

        //printf("Case %d: %.10lf",tc,ans);

    }

    return 0;

}

/*

    problems are the sign of life

*/


// Faster C++ solution for the same problem (measured speedup: 5.340522570804374x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
#include<iostream>



using namespace std;



int main()

{

    int a;

    cin>>a;

    cout<<a+(a*a)+(a*a*a)<<endl;

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 5.271186138467951x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main()

{

    int a;

    cin>>a;

    cout<<a + a*a +a*a*a;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.261636796942854x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

using namespace std;



int a, b, c;



int main () {

    cin >> a ;

    b = a*a ;

    c = a*a*a ;

    cout << a+b+c << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.271017143598592x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// itung lg

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



//B - Calc

int h;

int main() {

    cin >> h;

    cout << h + h*h + h*h*h << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



//heyyyy



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    // aulia 

    cin >> x;

    cout << x + x*x + x*x*x << endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a;



int main () {

	cin >> a;

	cout << a + a*a + a*a*a;

}

// Faster C++ solution for the same problem (measured speedup: 5.264901806462063x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a, result;



int main () {

    cin >> a;

    result = a + a*a + a*a*a;

    cout << result << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;

int main() {

    cin >> a;

    cout <<a+a*a+a*a*a<< endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>

int main(){

	int n;

	scanf("%d", &n);

	printf("%d", n+(n*n)+(n*n*n));

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ll long long int

#define pb push_back

#define ii pair<int,int>

#define setin set.insert

using namespace std;



void solve()

{

    int a;

    cin >> a;

    ll c=a+(a*a)+(a*a*a);

    cout << c << endl;

}



int main()

{



    solve();



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.265113723163919x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
//i hate _____

#include<bits/stdc++.h>



#define ll long long int 

#define ld long double 

#define pb push_back

#define mk make_pair

#define ii pair<int,int>



using namespace std;

double pi=2*acos(0.0);



/*freopen("input.txt","r",stdin);

freopen("output.txt","w",stdout);*/



template<typename T> 

ostream& operator<<(ostream &os, const vector<T> &v) { 

    os << '{'; 

    for (const auto &x : v) os << " " << x;

        return os << '}'; 

}



void solve(){

    int n; cin>>n;

    int ans=n+(n*n)+(n*n*n);

    cout << ans << endl;

}



int main()

{

    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);



    int test_cases=1; 

    //cin>>test_cases;



    for (int tc=1;tc<=test_cases;tc++){

        

        solve();

        //cout << "Case " << tc << ": " << solve() <<endl;

        //printf("Case %d: %.10lf",tc,ans);

    }

    return 0;

}

/*

    problems are the sign of life

*/


// Faster C++ solution for the same problem (measured speedup: 5.340522570804374x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
#include<iostream>



using namespace std;



int main()

{

    int a;

    cin>>a;

    cout<<a+(a*a)+(a*a*a)<<endl;

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 5.271186138467951x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main()

{

    int a;

    cin>>a;

    cout<<a + a*a +a*a*a;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.261636796942854x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

using namespace std;



int a, b, c;



int main () {

    cin >> a ;

    b = a*a ;

    c = a*a*a ;

    cout << a+b+c << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.271017143598592x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// itung lg

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



//B - Calc

int h;

int main() {

    cin >> h;

    cout << h + h*h + h*h*h << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;



//heyyyy



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int x;



int main() {

    // aulia 

    cin >> x;

    cout << x + x*x + x*x*x << endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a;



int main () {

	cin >> a;

	cout << a + a*a + a*a*a;

}

// Faster C++ solution for the same problem (measured speedup: 5.264901806462063x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a, result;



int main () {

    cin >> a;

    result = a + a*a + a*a*a;

    cout << result << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.2716800188128525x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int a;

int main() {

    cin >> a;

    cout <<a+a*a+a*a*a<< endl;



}

// Faster C++ solution for the same problem (measured speedup: 5.270905549698419x):
#include <stdio.h>



int main () {

	int ang;

	scanf ("%d", &ang);

	printf ("%d", ang + ang*ang + ang*ang*ang);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ll long long int

#define pb push_back

#define ii pair<int,int>

#define setin set.insert

using namespace std;



void solve()

{

    int a;

    cin >> a;

    ll c=a+(a*a)+(a*a*a);

    cout << c << endl;

}



int main()

{



    solve();



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.263820621468319x):
#include <stdio.h>



int main(){

	int n=0;

	scanf("%d", &n);

	int a=n;

	int b=n*n;

	int c=n*n*n;

	

	printf("%d", a+b+c);	

	return 0;

}
// Slower C++ solution:
//i hate _____

#include<bits/stdc++.h>



#define ll long long int 

#define ld long double 

#define pb push_back

#define mk make_pair

#define ii pair<int,int>



using namespace std;

double pi=2*acos(0.0);



/*freopen("input.txt","r",stdin);

freopen("output.txt","w",stdout);*/



template<typename T> 

ostream& operator<<(ostream &os, const vector<T> &v) { 

    os << '{'; 

    for (const auto &x : v) os << " " << x;

        return os << '}'; 

}



void solve(){

    int n; cin>>n;

    int ans=n+(n*n)+(n*n*n);

    cout << ans << endl;

}



int main()

{

    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);



    int test_cases=1; 

    //cin>>test_cases;



    for (int tc=1;tc<=test_cases;tc++){

        

        solve();

        //cout << "Case " << tc << ": " << solve() <<endl;

        //printf("Case %d: %.10lf",tc,ans);

    }

    return 0;

}

/*

    problems are the sign of life

*/


// Faster C++ solution for the same problem (measured speedup: 5.339210948842382x):
#include <stdio.h>



int main(){

	int n=0;

	scanf("%d", &n);

	int a=n;

	int b=n*n;

	int c=n*n*n;

	

	printf("%d", a+b+c);	

	return 0;

}
// Slower C++ solution:
#include<iostream>



using namespace std;



int main()

{

    int a;

    cin>>a;

    cout<<a+(a*a)+(a*a*a)<<endl;

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 5.269891545398957x):
#include <stdio.h>



int main(){

	int n=0;

	scanf("%d", &n);

	int a=n;

	int b=n*n;

	int c=n*n*n;

	

	printf("%d", a+b+c);	

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main()

{

    int a;

    cin>>a;

    cout<<a + a*a +a*a*a;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.260344549173576x):
#include <stdio.h>



int main(){

	int n=0;

	scanf("%d", &n);

	int a=n;

	int b=n*n;

	int c=n*n*n;

	

	printf("%d", a+b+c);	

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

using namespace std;



int a, b, c;



int main () {

    cin >> a ;

    b = a*a ;

    c = a*a*a ;

    cout << a+b+c << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.26972259203441x):
#include <stdio.h>



int main(){

	int n=0;

	scanf("%d", &n);

	int a=n;

	int b=n*n;

	int c=n*n*n;

	

	printf("%d", a+b+c);	

	return 0;

}