import java.util.*;
import java.util.function.*;
import java.lang.*;
import java.io.*;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        
        System.err.printf("a = %d\n", a);
        System.out.println(a + a*a + a*a*a);
        
    }
} import java.util.*; util.* java import java.util.function.*; function.* java.util import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        
        System.err.printf("a = %d\n", a);
        System.out.println(a + a*a + a*a*a);
        
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        
        System.err.printf("a = %d\n", a);
        System.out.println(a + a*a + a*a*a);
        
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        
        System.err.printf("a = %d\n", a);
        System.out.println(a + a*a + a*a*a);
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc System.err.printf("a = %d\n", a) System.err.printf System.err System System.err "a = %d\n" a System.out.println(a + a*a + a*a*a) System.out.println System.out System System.out 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 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        
        System.err.printf("a = %d\n", a);
        System.out.println(a + a*a + a*a*a);
        
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        
        System.err.printf("a = %d\n", a);
        System.out.println(a + a*a + a*a*a);
        
    }
} Main
import java.util.*;
import java.util.function.*;
import java.lang.*;
import java.io.*;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        
        System.err.printf("a = %d\n", a);
        System.out.println(a + a*a + a*a*a);
        
    }
}
