import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        
        Scanner scan = new Scanner(System.in);
        
        int x = scan.nextInt();
        
        System.out.println(x + x*x + (int)Math.pow(x,3));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        
        Scanner scan = new Scanner(System.in);
        
        int x = scan.nextInt();
        
        System.out.println(x + x*x + (int)Math.pow(x,3));
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        
        Scanner scan = new Scanner(System.in);
        
        int x = scan.nextInt();
        
        System.out.println(x + x*x + (int)Math.pow(x,3));
    } main {
        // Your code here!
        
        Scanner scan = new Scanner(System.in);
        
        int x = scan.nextInt();
        
        System.out.println(x + x*x + (int)Math.pow(x,3));
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan System.out.println(x + x*x + (int)Math.pow(x,3)) System.out.println System.out System System.out x + x*x + (int)Math.pow(x,3) x + x*x + (int)Math.pow(x,3) x x*x x x (int)Math.pow(x,3) Math.pow Math x 3 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        
        Scanner scan = new Scanner(System.in);
        
        int x = scan.nextInt();
        
        System.out.println(x + x*x + (int)Math.pow(x,3));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        
        Scanner scan = new Scanner(System.in);
        
        int x = scan.nextInt();
        
        System.out.println(x + x*x + (int)Math.pow(x,3));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        
        Scanner scan = new Scanner(System.in);
        
        int x = scan.nextInt();
        
        System.out.println(x + x*x + (int)Math.pow(x,3));
    }
}
