import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int m = Integer.parseInt(br.readLine());
        System.out.println(problem172a(m));
    }

    private static int problem172a(int a) {
        return a + a * a + a * a * a;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int m = Integer.parseInt(br.readLine());
        System.out.println(problem172a(m));
    }

    private static int problem172a(int a) {
        return a + a * a + a * a * a;
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int m = Integer.parseInt(br.readLine());
        System.out.println(problem172a(m));
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int m = Integer.parseInt(br.readLine());
        System.out.println(problem172a(m));
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int m = Integer.parseInt(br.readLine()); m Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br System.out.println(problem172a(m)) System.out.println System.out System System.out problem172a(m) problem172a m String[] args args private static int problem172a(int a) {
        return a + a * a + a * a * a;
    } problem172a {
        return a + a * a + a * a * a;
    } return 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 a * a * a a a a int a a public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int m = Integer.parseInt(br.readLine());
        System.out.println(problem172a(m));
    }

    private static int problem172a(int a) {
        return a + a * a + a * a * a;
    }
} public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int m = Integer.parseInt(br.readLine());
        System.out.println(problem172a(m));
    }

    private static int problem172a(int a) {
        return a + a * a + a * a * a;
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int m = Integer.parseInt(br.readLine());
        System.out.println(problem172a(m));
    }

    private static int problem172a(int a) {
        return a + a * a + a * a * a;
    }
}