import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args) throws Exception {
        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        long n = Integer.parseInt(buffer.readLine());
        long sum = n + n*n + n*n*n;
        sb.append(sum);
        System.out.println(sb);
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main{
    public static void main(String[] args) throws Exception {
        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        long n = Integer.parseInt(buffer.readLine());
        long sum = n + n*n + n*n*n;
        sb.append(sum);
        System.out.println(sb);
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        long n = Integer.parseInt(buffer.readLine());
        long sum = n + n*n + n*n*n;
        sb.append(sum);
        System.out.println(sb);
    } main {
        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        long n = Integer.parseInt(buffer.readLine());
        long sum = n + n*n + n*n*n;
        sb.append(sum);
        System.out.println(sb);
    } BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in)); buffer new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() long n = Integer.parseInt(buffer.readLine()); n Integer.parseInt(buffer.readLine()) Integer.parseInt Integer buffer.readLine() buffer.readLine buffer long sum = n + n*n + n*n*n; sum n + n*n + n*n*n n + n*n + n*n*n n n*n n n n*n*n n*n*n n n n sb.append(sum) sb.append sb sum System.out.println(sb) System.out.println System.out System System.out sb String[] args args
import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args) throws Exception {
        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        long n = Integer.parseInt(buffer.readLine());
        long sum = n + n*n + n*n*n;
        sb.append(sum);
        System.out.println(sb);
    }
}
