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

/**
 * A https://atcoder.jp/contests/abc172/tasks/abc172_a
 * 
 */
public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        try {
            int a = Integer.parseInt(reader.readLine());
            System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
        } catch (NumberFormatException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        try {
            int a = Integer.parseInt(reader.readLine());
            System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
        } catch (NumberFormatException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    }
} Main public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        try {
            int a = Integer.parseInt(reader.readLine());
            System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
        } catch (NumberFormatException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    } main {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        try {
            int a = Integer.parseInt(reader.readLine());
            System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
        } catch (NumberFormatException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) try {
            int a = Integer.parseInt(reader.readLine());
            System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
        } catch (NumberFormatException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (NumberFormatException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } NumberFormatException | IOException e {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            int a = Integer.parseInt(reader.readLine());
            System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
        } int a = Integer.parseInt(reader.readLine()); a Integer.parseInt(reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3))) System.out.println System.out System System.out (int) (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 String[] args args public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        try {
            int a = Integer.parseInt(reader.readLine());
            System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
        } catch (NumberFormatException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    }
} public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        try {
            int a = Integer.parseInt(reader.readLine());
            System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
        } catch (NumberFormatException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

/**
 * A https://atcoder.jp/contests/abc172/tasks/abc172_a
 * 
 */
public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        try {
            int a = Integer.parseInt(reader.readLine());
            System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
        } catch (NumberFormatException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    }
}