stablegradients/pie-gem5-pairs huggingface dataset:
// 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.269611025541482x):
#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;



//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.269611025541482x):
#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 a;



//heyyyy



int main() {

    cin >> a;

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

}

// Faster C++ solution for the same problem (measured speedup: 5.269611025541482x):
#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 x;



int main() {

    // aulia 

    cin >> x;

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



}

// Faster C++ solution for the same problem (measured speedup: 5.269611025541482x):
#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 a;



int main () {

	cin >> a;

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

}

// Faster C++ solution for the same problem (measured speedup: 5.263608756812794x):
#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 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.270385304447806x):
#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 a;

int main() {

    cin >> a;

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



}

// Faster C++ solution for the same problem (measured speedup: 5.269611025541482x):
#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>

#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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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 a, sum;

	scanf("%d", &a);

	sum = a + (a*a) + (a*a*a);

	

	printf("%d", sum);

	

	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.265632861318976x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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.341049144242334x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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.271705875360784x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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.262155592274345x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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.271536863828597x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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.271425258925309x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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.271425258925309x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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.271425258925309x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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.271425258925309x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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.265420923722217x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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.272199804402095x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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.271425258925309x):
#include <stdio.h>

int main(){

    

    

    

    long long int n;

    scanf("%lld", &n);

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









}
// 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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 a;

	int powerOne, powerTwo, powerThree, total;

	

	scanf("%d", &a);

	

	powerOne = a;

	powerTwo = a * a;

	powerThree = a * a * a;

	total = powerOne + powerTwo + powerThree;

	

	printf("%d", total);

	

	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 total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	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 total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	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 total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	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 total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	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 total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	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 total,a;

	scanf("%d", &a);

	total = a + (a*a) + (a * a * a);

	

	printf("%d", total);

	

	return 0;	

}