import java.io.*;

/**
 * Created by Ayushi on 27 Jun 2020.
 * Problem:
 * Round:
 */

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(br.readLine());
        br.close();
        long b = (long) (a + (Math.pow(a, 2)) + (Math.pow(a, 3)));
        System.out.println(b);
    }
} import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(br.readLine());
        br.close();
        long b = (long) (a + (Math.pow(a, 2)) + (Math.pow(a, 3)));
        System.out.println(b);
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(br.readLine());
        br.close();
        long b = (long) (a + (Math.pow(a, 2)) + (Math.pow(a, 3)));
        System.out.println(b);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(br.readLine());
        br.close();
        long b = (long) (a + (Math.pow(a, 2)) + (Math.pow(a, 3)));
        System.out.println(b);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int a = Integer.parseInt(br.readLine()); a Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br br.close() br.close br long b = (long) (a + (Math.pow(a, 2)) + (Math.pow(a, 3))); b (long) (a + (Math.pow(a, 2)) + (Math.pow(a, 3))) a + (Math.pow(a, 2)) + (Math.pow(a, 3)) a (Math.pow(a, 2)) Math.pow Math a 2 (Math.pow(a, 3)) Math.pow Math a 3 System.out.println(b) System.out.println System.out System System.out b String[] args args public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(br.readLine());
        br.close();
        long b = (long) (a + (Math.pow(a, 2)) + (Math.pow(a, 3)));
        System.out.println(b);
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(br.readLine());
        br.close();
        long b = (long) (a + (Math.pow(a, 2)) + (Math.pow(a, 3)));
        System.out.println(b);
    }
} Main
import java.io.*;

/**
 * Created by Ayushi on 27 Jun 2020.
 * Problem:
 * Round:
 */

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(br.readLine());
        br.close();
        long b = (long) (a + (Math.pow(a, 2)) + (Math.pow(a, 3)));
        System.out.println(b);
    }
}
