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

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String s;
        while ((s = in.readLine()) != null) {
            int i = Integer.parseInt(s);
            int ret = i + i * i + i * i * i;
            System.out.println(ret);
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String s;
        while ((s = in.readLine()) != null) {
            int i = Integer.parseInt(s);
            int ret = i + i * i + i * i * i;
            System.out.println(ret);
        }
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String s;
        while ((s = in.readLine()) != null) {
            int i = Integer.parseInt(s);
            int ret = i + i * i + i * i * i;
            System.out.println(ret);
        }
    } main {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String s;
        while ((s = in.readLine()) != null) {
            int i = Integer.parseInt(s);
            int ret = i + i * i + i * i * i;
            System.out.println(ret);
        }
    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String s; s while ((s = in.readLine()) != null) {
            int i = Integer.parseInt(s);
            int ret = i + i * i + i * i * i;
            System.out.println(ret);
        } (s = in.readLine()) != null (s = in.readLine()) s in.readLine() in.readLine in null {
            int i = Integer.parseInt(s);
            int ret = i + i * i + i * i * i;
            System.out.println(ret);
        } int i = Integer.parseInt(s); i Integer.parseInt(s) Integer.parseInt Integer s int ret = i + i * i + i * i * i; ret i + i * i + i * i * i i + i * i + i * i * i i i * i i i i * i * i i * i * i i i i System.out.println(ret) System.out.println System.out System System.out ret String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String s;
        while ((s = in.readLine()) != null) {
            int i = Integer.parseInt(s);
            int ret = i + i * i + i * i * i;
            System.out.println(ret);
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String s;
        while ((s = in.readLine()) != null) {
            int i = Integer.parseInt(s);
            int ret = i + i * i + i * i * i;
            System.out.println(ret);
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String s;
        while ((s = in.readLine()) != null) {
            int i = Integer.parseInt(s);
            int ret = i + i * i + i * i * i;
            System.out.println(ret);
        }
    }
}
