import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt();
        int ans = a + a*a + a*a*a;
        lp(ans);
    }
    public static void lp(Object o){
        System.out.println(o);
    }
} 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 ans = a + a*a + a*a*a;
        lp(ans);
    }
    public static void lp(Object o){
        System.out.println(o);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt();
        int ans = a + a*a + a*a*a;
        lp(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt();
        int ans = a + a*a + a*a*a;
        lp(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc int ans = a + a*a + a*a*a; ans 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 lp(ans) lp ans String[] args args public static void lp(Object o){
        System.out.println(o);
    } lp {
        System.out.println(o);
    } System.out.println(o) System.out.println System.out System System.out o Object o o public class Main {

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

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt();
        int ans = a + a*a + a*a*a;
        lp(ans);
    }
    public static void lp(Object o){
        System.out.println(o);
    }
} 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 ans = a + a*a + a*a*a;
        lp(ans);
    }
    public static void lp(Object o){
        System.out.println(o);
    }
}
