
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {


    public static void main(String[] args) {


        Scanner scan = new Scanner(System.in);
int p=scan.nextInt();
p=p+(int)Math.pow(p,2)+(int)Math.pow(p,3);

System.out.println(p);
    }
    }



 import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {


    public static void main(String[] args) {


        Scanner scan = new Scanner(System.in);
int p=scan.nextInt();
p=p+(int)Math.pow(p,2)+(int)Math.pow(p,3);

System.out.println(p);
    }
    } Main public static void main(String[] args) {


        Scanner scan = new Scanner(System.in);
int p=scan.nextInt();
p=p+(int)Math.pow(p,2)+(int)Math.pow(p,3);

System.out.println(p);
    } main {


        Scanner scan = new Scanner(System.in);
int p=scan.nextInt();
p=p+(int)Math.pow(p,2)+(int)Math.pow(p,3);

System.out.println(p);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int p=scan.nextInt(); p scan.nextInt() scan.nextInt scan p=p+(int)Math.pow(p,2)+(int)Math.pow(p,3) p p+(int)Math.pow(p,2)+(int)Math.pow(p,3) p+(int)Math.pow(p,2)+(int)Math.pow(p,3) p (int)Math.pow(p,2) Math.pow Math p 2 (int)Math.pow(p,3) Math.pow Math p 3 System.out.println(p) System.out.println System.out System System.out p String[] args args public class Main {


    public static void main(String[] args) {


        Scanner scan = new Scanner(System.in);
int p=scan.nextInt();
p=p+(int)Math.pow(p,2)+(int)Math.pow(p,3);

System.out.println(p);
    }
    } public class Main {


    public static void main(String[] args) {


        Scanner scan = new Scanner(System.in);
int p=scan.nextInt();
p=p+(int)Math.pow(p,2)+(int)Math.pow(p,3);

System.out.println(p);
    }
    } Main

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {


    public static void main(String[] args) {


        Scanner scan = new Scanner(System.in);
int p=scan.nextInt();
p=p+(int)Math.pow(p,2)+(int)Math.pow(p,3);

System.out.println(p);
    }
    }




