//package com.company;
import java.util.*;
import java.lang.*;
import java.io.*;
//****Use Integer Wrapper Class for Arrays.sort()****
public class Main {
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
    public static void main(String[] Args)throws Exception{
        FastReader scan=new FastReader(System.in);
//        int t=1;
//        t=scan.nextInt();
//        while(t-->0){
//            int[][] mat={{1,0,1},{1,1,0},{1,1,0}};
//            numSubmat(mat);
//        }
        int a=scan.nextInt();
        out.println(a+a*a+a*a*a);
        out.flush();
        out.close();
    }
    static int numSubmat(int[][] mat) {
        int n=mat.length;
        int m=mat[0].length;
        // System.out.println(n+" "+m);
        for(int i=0;i<n;i++){
            for(int j=1;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            }
            // System.out.println();
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            }
            System.out.println();
        }
        int ans=0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            }
            System.out.println();
        }
        return ans;
    }
    static class FastReader {

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        FastReader(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan()) ;
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
    public static void main(String[] Args)throws Exception{
        FastReader scan=new FastReader(System.in);
//        int t=1;
//        t=scan.nextInt();
//        while(t-->0){
//            int[][] mat={{1,0,1},{1,1,0},{1,1,0}};
//            numSubmat(mat);
//        }
        int a=scan.nextInt();
        out.println(a+a*a+a*a*a);
        out.flush();
        out.close();
    }
    static int numSubmat(int[][] mat) {
        int n=mat.length;
        int m=mat[0].length;
        // System.out.println(n+" "+m);
        for(int i=0;i<n;i++){
            for(int j=1;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            }
            // System.out.println();
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            }
            System.out.println();
        }
        int ans=0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            }
            System.out.println();
        }
        return ans;
    }
    static class FastReader {

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        FastReader(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan()) ;
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    }
} Main static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out)); out new PrintWriter(new OutputStreamWriter(System.out)) public static void main(String[] Args)throws Exception{
        FastReader scan=new FastReader(System.in);
//        int t=1;
//        t=scan.nextInt();
//        while(t-->0){
//            int[][] mat={{1,0,1},{1,1,0},{1,1,0}};
//            numSubmat(mat);
//        }
        int a=scan.nextInt();
        out.println(a+a*a+a*a*a);
        out.flush();
        out.close();
    } main {
        FastReader scan=new FastReader(System.in);
//        int t=1;
//        t=scan.nextInt();
//        while(t-->0){
//            int[][] mat={{1,0,1},{1,1,0},{1,1,0}};
//            numSubmat(mat);
//        }
        int a=scan.nextInt();
        out.println(a+a*a+a*a*a);
        out.flush();
        out.close();
    } FastReader scan=new FastReader(System.in); scan new FastReader(System.in) int a=scan.nextInt(); a scan.nextInt() scan.nextInt scan out.println(a+a*a+a*a*a) out.println out 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 out.flush() out.flush out out.close() out.close out String[] Args Args static int numSubmat(int[][] mat) {
        int n=mat.length;
        int m=mat[0].length;
        // System.out.println(n+" "+m);
        for(int i=0;i<n;i++){
            for(int j=1;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            }
            // System.out.println();
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            }
            System.out.println();
        }
        int ans=0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            }
            System.out.println();
        }
        return ans;
    } numSubmat {
        int n=mat.length;
        int m=mat[0].length;
        // System.out.println(n+" "+m);
        for(int i=0;i<n;i++){
            for(int j=1;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            }
            // System.out.println();
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            }
            System.out.println();
        }
        int ans=0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            }
            System.out.println();
        }
        return ans;
    } int n=mat.length; n mat.length mat mat.length int m=mat[0].length; m mat[0].length mat[0] mat 0 mat[0].length for(int i=0;i<n;i++){
            for(int j=1;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            }
            // System.out.println();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            for(int j=1;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            }
            // System.out.println();
        } {
            for(int j=1;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            }
            // System.out.println();
        } for(int j=1;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            } int j=1; int j=1; j 1 j<m j m j++ j++ j {
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            } {
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            } if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                } mat[i][j]==1 mat[i][j] mat[i] mat i j 1 {
                    mat[i][j]+=mat[i][j-1];
                } mat[i][j]+=mat[i][j-1] mat[i][j] mat[i] mat i j mat[i][j-1] mat[i] mat i j-1 j 1 for(int i=1;i<n;i++){
            for(int j=0;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            }
            System.out.println();
        } int i=1; int i=1; i 1 i<n i n i++ i++ i {
            for(int j=0;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            }
            System.out.println();
        } {
            for(int j=0;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            }
            System.out.println();
        } for(int j=0;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            } int j=0; int j=0; j 0 j<m j m j++ j++ j {
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            } {
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            } if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                } mat[i][j]==1 mat[i][j] mat[i] mat i j 1 {
                    mat[i][j]+=mat[i-1][j];
                } mat[i][j]+=mat[i-1][j] mat[i][j] mat[i] mat i j mat[i-1][j] mat[i-1] mat i-1 i 1 j System.out.print(mat[i][j]+" ") System.out.print System.out System System.out mat[i][j]+" " mat[i][j] mat[i] mat i j " " System.out.println() System.out.println System.out System System.out int ans=0; ans 0 for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            }
            System.out.println();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            for(int j=0;j<m;j++){
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            }
            System.out.println();
        } {
            for(int j=0;j<m;j++){
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            }
            System.out.println();
        } for(int j=0;j<m;j++){
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            } int j=0; int j=0; j 0 j<m j m j++ j++ j {
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            } {
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            } System.out.print(mat[i][j]+" ") System.out.print System.out System System.out mat[i][j]+" " mat[i][j] mat[i] mat i j " " ans+=mat[i][j] ans mat[i][j] mat[i] mat i j System.out.println() System.out.println System.out System System.out return ans; ans int[][] mat mat static class FastReader {

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        FastReader(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan()) ;
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    } FastReader byte[] buf = new byte[2048]; buf new byte[2048] 2048 int index index total; total InputStream in; in FastReader(InputStream is) {
            in = is;
        } FastReader {
            in = is;
        } in = is in is InputStream is is int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        } scan {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        } if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            } index >= total index total {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            } index = 0 index 0 total = in.read(buf) total in.read(buf) in.read in buf if (total <= 0) {
                    return -1;
                } total <= 0 total 0 {
                    return -1;
                } return -1; -1 1 return buf[index++]; buf[index++] buf index++ index String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan()) ;
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        } next {
            int c;
            for (c = scan(); c <= 32; c = scan()) ;
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        } int c; c for (c = scan(); c <= 32; c = scan()) ; c = scan(); c = scan() c scan() scan c <= 32 c 32 c = scan() c = scan() c scan() scan ; StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (; c > 32; c = scan()) {
                sb.append((char) c);
            } ; c > 32 c 32 c = scan() c = scan() c scan() scan {
                sb.append((char) c);
            } {
                sb.append((char) c);
            } sb.append((char) c) sb.append sb (char) c return sb.toString(); sb.toString() sb.toString sb int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        } nextInt {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        } int c c val = 0; val 0 for (c = scan(); c <= 32; c = scan()) ; c = scan(); c = scan() c scan() scan c <= 32 c 32 c = scan() c = scan() c scan() scan ; boolean neg = c == '-'; neg c == '-' c '-' if (c == '-' || c == '+') {
                c = scan();
            } c == '-' || c == '+' c == '-' c '-' c == '+' c '+' {
                c = scan();
            } c = scan() c scan() scan for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            } ; c >= '0' && c <= '9' c >= '0' c '0' c <= '9' c '9' c = scan() c = scan() c scan() scan {
                val = (val << 3) + (val << 1) + (c & 15);
            } {
                val = (val << 3) + (val << 1) + (c & 15);
            } val = (val << 3) + (val << 1) + (c & 15) val (val << 3) + (val << 1) + (c & 15) (val << 3) + (val << 1) + (c & 15) (val << 3) val 3 (val << 1) val 1 (c & 15) c 15 return neg ? -val : val; neg ? -val : val neg -val val val long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        } nextLong {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        } int c; c long val = 0; val 0 for (c = scan(); c <= 32; c = scan()) ; c = scan(); c = scan() c scan() scan c <= 32 c 32 c = scan() c = scan() c scan() scan ; boolean neg = c == '-'; neg c == '-' c '-' if (c == '-' || c == '+') {
                c = scan();
            } c == '-' || c == '+' c == '-' c '-' c == '+' c '+' {
                c = scan();
            } c = scan() c scan() scan for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            } ; c >= '0' && c <= '9' c >= '0' c '0' c <= '9' c '9' c = scan() c = scan() c scan() scan {
                val = (val << 3) + (val << 1) + (c & 15);
            } {
                val = (val << 3) + (val << 1) + (c & 15);
            } val = (val << 3) + (val << 1) + (c & 15) val (val << 3) + (val << 1) + (c & 15) (val << 3) + (val << 1) + (c & 15) (val << 3) val 3 (val << 1) val 1 (c & 15) c 15 return neg ? -val : val; neg ? -val : val neg -val val val public class Main {
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
    public static void main(String[] Args)throws Exception{
        FastReader scan=new FastReader(System.in);
//        int t=1;
//        t=scan.nextInt();
//        while(t-->0){
//            int[][] mat={{1,0,1},{1,1,0},{1,1,0}};
//            numSubmat(mat);
//        }
        int a=scan.nextInt();
        out.println(a+a*a+a*a*a);
        out.flush();
        out.close();
    }
    static int numSubmat(int[][] mat) {
        int n=mat.length;
        int m=mat[0].length;
        // System.out.println(n+" "+m);
        for(int i=0;i<n;i++){
            for(int j=1;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            }
            // System.out.println();
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            }
            System.out.println();
        }
        int ans=0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            }
            System.out.println();
        }
        return ans;
    }
    static class FastReader {

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        FastReader(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan()) ;
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    }
} public class Main {
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
    public static void main(String[] Args)throws Exception{
        FastReader scan=new FastReader(System.in);
//        int t=1;
//        t=scan.nextInt();
//        while(t-->0){
//            int[][] mat={{1,0,1},{1,1,0},{1,1,0}};
//            numSubmat(mat);
//        }
        int a=scan.nextInt();
        out.println(a+a*a+a*a*a);
        out.flush();
        out.close();
    }
    static int numSubmat(int[][] mat) {
        int n=mat.length;
        int m=mat[0].length;
        // System.out.println(n+" "+m);
        for(int i=0;i<n;i++){
            for(int j=1;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            }
            // System.out.println();
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            }
            System.out.println();
        }
        int ans=0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            }
            System.out.println();
        }
        return ans;
    }
    static class FastReader {

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        FastReader(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan()) ;
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    }
} Main
//package com.company;
import java.util.*;
import java.lang.*;
import java.io.*;
//****Use Integer Wrapper Class for Arrays.sort()****
public class Main {
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
    public static void main(String[] Args)throws Exception{
        FastReader scan=new FastReader(System.in);
//        int t=1;
//        t=scan.nextInt();
//        while(t-->0){
//            int[][] mat={{1,0,1},{1,1,0},{1,1,0}};
//            numSubmat(mat);
//        }
        int a=scan.nextInt();
        out.println(a+a*a+a*a*a);
        out.flush();
        out.close();
    }
    static int numSubmat(int[][] mat) {
        int n=mat.length;
        int m=mat[0].length;
        // System.out.println(n+" "+m);
        for(int i=0;i<n;i++){
            for(int j=1;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i][j-1];
                }
                // System.out.print(mat[i][j]+" ");
            }
            // System.out.println();
        }
        for(int i=1;i<n;i++){
            for(int j=0;j<m;j++){
                if(mat[i][j]==1){
                    mat[i][j]+=mat[i-1][j];
                }
                System.out.print(mat[i][j]+" ");
            }
            System.out.println();
        }
        int ans=0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                System.out.print(mat[i][j]+" ");
                ans+=mat[i][j];
            }
            System.out.println();
        }
        return ans;
    }
    static class FastReader {

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        FastReader(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan()) ;
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    }
}
