import java.util.*;
public class Main {
    public static void main(String[] args ){
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = a*a;
        long c = a*a*a;
        System.out.println(a+b+c);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args ){
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = a*a;
        long c = a*a*a;
        System.out.println(a+b+c);
    }
} Main public static void main(String[] args ){
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = a*a;
        long c = a*a*a;
        System.out.println(a+b+c);
    } main {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = a*a;
        long c = a*a*a;
        System.out.println(a+b+c);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = a*a; b a*a a a long c = a*a*a; c a*a*a a*a*a a a a System.out.println(a+b+c) System.out.println System.out System System.out a+b+c a+b+c a b c String[] args args public class Main {
    public static void main(String[] args ){
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = a*a;
        long c = a*a*a;
        System.out.println(a+b+c);
    }
} public class Main {
    public static void main(String[] args ){
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = a*a;
        long c = a*a*a;
        System.out.println(a+b+c);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args ){
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = a*a;
        long c = a*a*a;
        System.out.println(a+b+c);
    }
}
