import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = scanner.nextInt();
        
        System.out.println(a+a*a+a*a*a);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = scanner.nextInt();
        
        System.out.println(a+a*a+a*a*a);
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = scanner.nextInt();
        
        System.out.println(a+a*a+a*a*a);
    } main {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = scanner.nextInt();
        
        System.out.println(a+a*a+a*a*a);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner 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) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = scanner.nextInt();
        
        System.out.println(a+a*a+a*a*a);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = scanner.nextInt();
        
        System.out.println(a+a*a+a*a*a);
    }
} Main
import java.util.*;

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