//package atcoder.beginner_172;

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

public class Main {

    public static void main (String[] args) throws Exception {

        String s = "2";

//        br = new BufferedReader(new StringReader(s));
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));

        rl(); int a=nin();


        bw.write(Integer.toString(a+a*a+a*a*a));
        bw.newLine();
        bw.flush();

    }

    static BufferedReader br;
    static BufferedWriter bw;
    static StringTokenizer st;
    static void rl() throws Exception{
        st = new StringTokenizer(br.readLine());
    }
    static long nlo(){
        return Long.parseLong(st.nextToken());
    }
    static int nin(){
        return Integer.parseInt(st.nextToken());
    }
    /*private static void te(){
      }*/
    static double ndo(){
        return Double.parseDouble(st.nextToken());
    }
    static char[] nca(){
        return st.nextToken().toCharArray();
    }
    static String nstr(){
        return st.nextToken();
    }
} import java.io.*; io.* java import java.util.StringTokenizer; StringTokenizer java.util public class Main {

    public static void main (String[] args) throws Exception {

        String s = "2";

//        br = new BufferedReader(new StringReader(s));
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));

        rl(); int a=nin();


        bw.write(Integer.toString(a+a*a+a*a*a));
        bw.newLine();
        bw.flush();

    }

    static BufferedReader br;
    static BufferedWriter bw;
    static StringTokenizer st;
    static void rl() throws Exception{
        st = new StringTokenizer(br.readLine());
    }
    static long nlo(){
        return Long.parseLong(st.nextToken());
    }
    static int nin(){
        return Integer.parseInt(st.nextToken());
    }
    /*private static void te(){
      }*/
    static double ndo(){
        return Double.parseDouble(st.nextToken());
    }
    static char[] nca(){
        return st.nextToken().toCharArray();
    }
    static String nstr(){
        return st.nextToken();
    }
} Main static BufferedReader br; br static BufferedWriter bw; bw static StringTokenizer st; st public static void main (String[] args) throws Exception {

        String s = "2";

//        br = new BufferedReader(new StringReader(s));
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));

        rl(); int a=nin();


        bw.write(Integer.toString(a+a*a+a*a*a));
        bw.newLine();
        bw.flush();

    } main {

        String s = "2";

//        br = new BufferedReader(new StringReader(s));
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));

        rl(); int a=nin();


        bw.write(Integer.toString(a+a*a+a*a*a));
        bw.newLine();
        bw.flush();

    } String s = "2"; s "2" br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) bw = new BufferedWriter(new OutputStreamWriter(System.out)) bw new BufferedWriter(new OutputStreamWriter(System.out)) rl() rl int a=nin(); a nin() nin bw.write(Integer.toString(a+a*a+a*a*a)) bw.write bw Integer.toString(a+a*a+a*a*a) Integer.toString Integer 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 bw.newLine() bw.newLine bw bw.flush() bw.flush bw String[] args args static void rl() throws Exception{
        st = new StringTokenizer(br.readLine());
    } rl {
        st = new StringTokenizer(br.readLine());
    } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) static long nlo(){
        return Long.parseLong(st.nextToken());
    } nlo {
        return Long.parseLong(st.nextToken());
    } return Long.parseLong(st.nextToken()); Long.parseLong(st.nextToken()) Long.parseLong Long st.nextToken() st.nextToken st static int nin(){
        return Integer.parseInt(st.nextToken());
    } nin {
        return Integer.parseInt(st.nextToken());
    } return Integer.parseInt(st.nextToken()); Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st /*private static void te(){
      }*/
    static double ndo(){
        return Double.parseDouble(st.nextToken());
    } ndo {
        return Double.parseDouble(st.nextToken());
    } return Double.parseDouble(st.nextToken()); Double.parseDouble(st.nextToken()) Double.parseDouble Double st.nextToken() st.nextToken st static char[] nca(){
        return st.nextToken().toCharArray();
    } nca {
        return st.nextToken().toCharArray();
    } return st.nextToken().toCharArray(); st.nextToken().toCharArray() st.nextToken().toCharArray st.nextToken() st.nextToken st static String nstr(){
        return st.nextToken();
    } nstr {
        return st.nextToken();
    } return st.nextToken(); st.nextToken() st.nextToken st public class Main {

    public static void main (String[] args) throws Exception {

        String s = "2";

//        br = new BufferedReader(new StringReader(s));
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));

        rl(); int a=nin();


        bw.write(Integer.toString(a+a*a+a*a*a));
        bw.newLine();
        bw.flush();

    }

    static BufferedReader br;
    static BufferedWriter bw;
    static StringTokenizer st;
    static void rl() throws Exception{
        st = new StringTokenizer(br.readLine());
    }
    static long nlo(){
        return Long.parseLong(st.nextToken());
    }
    static int nin(){
        return Integer.parseInt(st.nextToken());
    }
    /*private static void te(){
      }*/
    static double ndo(){
        return Double.parseDouble(st.nextToken());
    }
    static char[] nca(){
        return st.nextToken().toCharArray();
    }
    static String nstr(){
        return st.nextToken();
    }
} public class Main {

    public static void main (String[] args) throws Exception {

        String s = "2";

//        br = new BufferedReader(new StringReader(s));
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));

        rl(); int a=nin();


        bw.write(Integer.toString(a+a*a+a*a*a));
        bw.newLine();
        bw.flush();

    }

    static BufferedReader br;
    static BufferedWriter bw;
    static StringTokenizer st;
    static void rl() throws Exception{
        st = new StringTokenizer(br.readLine());
    }
    static long nlo(){
        return Long.parseLong(st.nextToken());
    }
    static int nin(){
        return Integer.parseInt(st.nextToken());
    }
    /*private static void te(){
      }*/
    static double ndo(){
        return Double.parseDouble(st.nextToken());
    }
    static char[] nca(){
        return st.nextToken().toCharArray();
    }
    static String nstr(){
        return st.nextToken();
    }
} Main
//package atcoder.beginner_172;

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

public class Main {

    public static void main (String[] args) throws Exception {

        String s = "2";

//        br = new BufferedReader(new StringReader(s));
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));

        rl(); int a=nin();


        bw.write(Integer.toString(a+a*a+a*a*a));
        bw.newLine();
        bw.flush();

    }

    static BufferedReader br;
    static BufferedWriter bw;
    static StringTokenizer st;
    static void rl() throws Exception{
        st = new StringTokenizer(br.readLine());
    }
    static long nlo(){
        return Long.parseLong(st.nextToken());
    }
    static int nin(){
        return Integer.parseInt(st.nextToken());
    }
    /*private static void te(){
      }*/
    static double ndo(){
        return Double.parseDouble(st.nextToken());
    }
    static char[] nca(){
        return st.nextToken().toCharArray();
    }
    static String nstr(){
        return st.nextToken();
    }
}