import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
 
        int a = sc.nextInt();
        int ret = a + a*a + a*a*a;
        System.out.println(String.valueOf(ret));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
 
        int a = sc.nextInt();
        int ret = a + a*a + a*a*a;
        System.out.println(String.valueOf(ret));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
 
        int a = sc.nextInt();
        int ret = a + a*a + a*a*a;
        System.out.println(String.valueOf(ret));
    } main {
        Scanner sc = new Scanner(System.in);
 
        int a = sc.nextInt();
        int ret = a + a*a + a*a*a;
        System.out.println(String.valueOf(ret));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int ret = a + a*a + a*a*a; ret a + a*a + a*a*a a + a*a + a*a*a a a*a a a a*a*a a*a*a a a a System.out.println(String.valueOf(ret)) System.out.println System.out System System.out String.valueOf(ret) String.valueOf String ret String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
 
        int a = sc.nextInt();
        int ret = a + a*a + a*a*a;
        System.out.println(String.valueOf(ret));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
 
        int a = sc.nextInt();
        int ret = a + a*a + a*a*a;
        System.out.println(String.valueOf(ret));
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
 
        int a = sc.nextInt();
        int ret = a + a*a + a*a*a;
        System.out.println(String.valueOf(ret));
    }
}