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

public class Main {

    private static FastScanner sc;

    private static class FastScanner {
        private Scanner sc;

        FastScanner() {
            sc = new Scanner(System.in);
        }

        public int ni() {
            return sc.nextInt();
        }

        public String ns() {
            return sc.nextLine();
        }

        public long nl() {
            return sc.nextLong();
        }

        public double nd() {
            return sc.nextDouble();
        }
    }

    private static void print(Object o) {
        System.out.print(o);
    }

    private static void println(Object o) {
        System.out.println(o);
    }
    
    private static void printf(String s, Object... data) {
    	System.out.printf(s, data);	
    }

    public static void main(String[] args) {
        sc = new FastScanner();

        solve();
    }

    private static void solve() {
       int n = sc.ni();

       println(n + n*n + n*n*n);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {

    private static FastScanner sc;

    private static class FastScanner {
        private Scanner sc;

        FastScanner() {
            sc = new Scanner(System.in);
        }

        public int ni() {
            return sc.nextInt();
        }

        public String ns() {
            return sc.nextLine();
        }

        public long nl() {
            return sc.nextLong();
        }

        public double nd() {
            return sc.nextDouble();
        }
    }

    private static void print(Object o) {
        System.out.print(o);
    }

    private static void println(Object o) {
        System.out.println(o);
    }
    
    private static void printf(String s, Object... data) {
    	System.out.printf(s, data);	
    }

    public static void main(String[] args) {
        sc = new FastScanner();

        solve();
    }

    private static void solve() {
       int n = sc.ni();

       println(n + n*n + n*n*n);
    }
} Main private static FastScanner sc; sc private static void print(Object o) {
        System.out.print(o);
    } print {
        System.out.print(o);
    } System.out.print(o) System.out.print System.out System System.out o Object o o private static void println(Object o) {
        System.out.println(o);
    } println {
        System.out.println(o);
    } System.out.println(o) System.out.println System.out System System.out o Object o o private static void printf(String s, Object... data) {
    	System.out.printf(s, data);	
    } printf {
    	System.out.printf(s, data);	
    } System.out.printf(s, data) System.out.printf System.out System System.out s data String s s Object... data data public static void main(String[] args) {
        sc = new FastScanner();

        solve();
    } main {
        sc = new FastScanner();

        solve();
    } sc = new FastScanner() sc new FastScanner() solve() solve String[] args args private static void solve() {
       int n = sc.ni();

       println(n + n*n + n*n*n);
    } solve {
       int n = sc.ni();

       println(n + n*n + n*n*n);
    } int n = sc.ni(); n sc.ni() sc.ni sc println(n + n*n + n*n*n) println 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 private static class FastScanner {
        private Scanner sc;

        FastScanner() {
            sc = new Scanner(System.in);
        }

        public int ni() {
            return sc.nextInt();
        }

        public String ns() {
            return sc.nextLine();
        }

        public long nl() {
            return sc.nextLong();
        }

        public double nd() {
            return sc.nextDouble();
        }
    } FastScanner private Scanner sc; sc FastScanner() {
            sc = new Scanner(System.in);
        } FastScanner {
            sc = new Scanner(System.in);
        } sc = new Scanner(System.in) sc new Scanner(System.in) public int ni() {
            return sc.nextInt();
        } ni {
            return sc.nextInt();
        } return sc.nextInt(); sc.nextInt() sc.nextInt sc public String ns() {
            return sc.nextLine();
        } ns {
            return sc.nextLine();
        } return sc.nextLine(); sc.nextLine() sc.nextLine sc public long nl() {
            return sc.nextLong();
        } nl {
            return sc.nextLong();
        } return sc.nextLong(); sc.nextLong() sc.nextLong sc public double nd() {
            return sc.nextDouble();
        } nd {
            return sc.nextDouble();
        } return sc.nextDouble(); sc.nextDouble() sc.nextDouble sc public class Main {

    private static FastScanner sc;

    private static class FastScanner {
        private Scanner sc;

        FastScanner() {
            sc = new Scanner(System.in);
        }

        public int ni() {
            return sc.nextInt();
        }

        public String ns() {
            return sc.nextLine();
        }

        public long nl() {
            return sc.nextLong();
        }

        public double nd() {
            return sc.nextDouble();
        }
    }

    private static void print(Object o) {
        System.out.print(o);
    }

    private static void println(Object o) {
        System.out.println(o);
    }
    
    private static void printf(String s, Object... data) {
    	System.out.printf(s, data);	
    }

    public static void main(String[] args) {
        sc = new FastScanner();

        solve();
    }

    private static void solve() {
       int n = sc.ni();

       println(n + n*n + n*n*n);
    }
} public class Main {

    private static FastScanner sc;

    private static class FastScanner {
        private Scanner sc;

        FastScanner() {
            sc = new Scanner(System.in);
        }

        public int ni() {
            return sc.nextInt();
        }

        public String ns() {
            return sc.nextLine();
        }

        public long nl() {
            return sc.nextLong();
        }

        public double nd() {
            return sc.nextDouble();
        }
    }

    private static void print(Object o) {
        System.out.print(o);
    }

    private static void println(Object o) {
        System.out.println(o);
    }
    
    private static void printf(String s, Object... data) {
    	System.out.printf(s, data);	
    }

    public static void main(String[] args) {
        sc = new FastScanner();

        solve();
    }

    private static void solve() {
       int n = sc.ni();

       println(n + n*n + n*n*n);
    }
} Main
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {

    private static FastScanner sc;

    private static class FastScanner {
        private Scanner sc;

        FastScanner() {
            sc = new Scanner(System.in);
        }

        public int ni() {
            return sc.nextInt();
        }

        public String ns() {
            return sc.nextLine();
        }

        public long nl() {
            return sc.nextLong();
        }

        public double nd() {
            return sc.nextDouble();
        }
    }

    private static void print(Object o) {
        System.out.print(o);
    }

    private static void println(Object o) {
        System.out.println(o);
    }
    
    private static void printf(String s, Object... data) {
    	System.out.printf(s, data);	
    }

    public static void main(String[] args) {
        sc = new FastScanner();

        solve();
    }

    private static void solve() {
       int n = sc.ni();

       println(n + n*n + n*n*n);
    }
}