
// Java program For handling Input/Output 
import java.io.*;
import java.util.*;
import java.math.*;
//import java.awt.*;

public class Main {
    BufferedReader br;
    StringTokenizer st;

    int max = -1;
    final long P = 998244353;
    final long P2 = 1000000007;

    HashSet<String> set = new HashSet<>();
    HashMap<Character, List<Integer>> map = new HashMap<>();

    // actual logic
    void solve() throws IOException {
        // int t = ni();
        // while (--t >= 0) {
        long a = nl();
        pl(a + a * a + a * a * a);
        // }

    }

    // constructor
    Main() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        } catch (Exception e) {
            System.out.println(e);
        }
    }

    Main(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
            st = new StringTokenizer(br.readLine());
        } catch (Exception e) {
            System.out.println(e);
        }
    }

    // main metohd
    public static void main(String[] args) throws IOException {
        new Main().solve();
    }

    // Utility methods

    String ns() {
        if (!st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        }
        return st.nextToken();

    }

    int ni() {
        return Integer.parseInt(ns());
    }

    long nl() {
        return Long.parseLong(ns());
    }

    double nd() {
        return Double.parseDouble(ns());
    }

    void pl(String s) {
        System.out.println(s);
    }

    void pl(long s) {
        System.out.println(s);
    }

    void pl(double s) {
        System.out.println(s);
    }
} import java.io.*; io.* java import java.util.*; util.* java import java.math.*; math.* java public class Main {
    BufferedReader br;
    StringTokenizer st;

    int max = -1;
    final long P = 998244353;
    final long P2 = 1000000007;

    HashSet<String> set = new HashSet<>();
    HashMap<Character, List<Integer>> map = new HashMap<>();

    // actual logic
    void solve() throws IOException {
        // int t = ni();
        // while (--t >= 0) {
        long a = nl();
        pl(a + a * a + a * a * a);
        // }

    }

    // constructor
    Main() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        } catch (Exception e) {
            System.out.println(e);
        }
    }

    Main(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
            st = new StringTokenizer(br.readLine());
        } catch (Exception e) {
            System.out.println(e);
        }
    }

    // main metohd
    public static void main(String[] args) throws IOException {
        new Main().solve();
    }

    // Utility methods

    String ns() {
        if (!st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        }
        return st.nextToken();

    }

    int ni() {
        return Integer.parseInt(ns());
    }

    long nl() {
        return Long.parseLong(ns());
    }

    double nd() {
        return Double.parseDouble(ns());
    }

    void pl(String s) {
        System.out.println(s);
    }

    void pl(long s) {
        System.out.println(s);
    }

    void pl(double s) {
        System.out.println(s);
    }
} Main BufferedReader br; br StringTokenizer st; st int max = -1; max -1 1 final long P = 998244353; P 998244353 final long P2 = 1000000007; P2 1000000007 HashSet<String> set = new HashSet<>(); set new HashSet<>() HashMap<Character, List<Integer>> map = new HashMap<>(); map new HashMap<>() // actual logic
    void solve() throws IOException {
        // int t = ni();
        // while (--t >= 0) {
        long a = nl();
        pl(a + a * a + a * a * a);
        // }

    } solve {
        // int t = ni();
        // while (--t >= 0) {
        long a = nl();
        pl(a + a * a + a * a * a);
        // }

    } long a = nl(); a nl() nl pl(a + a * a + a * a * a) pl 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 // constructor
    Main() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        } catch (Exception e) {
            System.out.println(e);
        }
    } Main {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        } catch (Exception e) {
            System.out.println(e);
        }
    } try {
            br = new BufferedReader(new InputStreamReader(System.in));
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        } catch (Exception e) {
            System.out.println(e);
        } catch (Exception e) {
            System.out.println(e);
        } Exception e {
            System.out.println(e);
        } System.out.println(e) System.out.println System.out System System.out e {
            br = new BufferedReader(new InputStreamReader(System.in));
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            } catch (Exception e) {
                System.out.println(e);
            } Exception e {
                System.out.println(e);
            } System.out.println(e) System.out.println System.out System System.out e {
                st = new StringTokenizer(br.readLine());
            } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) Main(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
            st = new StringTokenizer(br.readLine());
        } catch (Exception e) {
            System.out.println(e);
        }
    } Main {
        try {
            br = new BufferedReader(new FileReader(s));
            st = new StringTokenizer(br.readLine());
        } catch (Exception e) {
            System.out.println(e);
        }
    } try {
            br = new BufferedReader(new FileReader(s));
            st = new StringTokenizer(br.readLine());
        } catch (Exception e) {
            System.out.println(e);
        } catch (Exception e) {
            System.out.println(e);
        } Exception e {
            System.out.println(e);
        } System.out.println(e) System.out.println System.out System System.out e {
            br = new BufferedReader(new FileReader(s));
            st = new StringTokenizer(br.readLine());
        } br = new BufferedReader(new FileReader(s)) br new BufferedReader(new FileReader(s)) st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) String s s // main metohd
    public static void main(String[] args) throws IOException {
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args String ns() {
        if (!st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        }
        return st.nextToken();

    } ns {
        if (!st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        }
        return st.nextToken();

    } if (!st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        } !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        } try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            } catch (Exception e) {
                System.out.println(e);
            } Exception e {
                System.out.println(e);
            } System.out.println(e) System.out.println System.out System System.out e {
                st = new StringTokenizer(br.readLine());
            } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int ni() {
        return Integer.parseInt(ns());
    } ni {
        return Integer.parseInt(ns());
    } return Integer.parseInt(ns()); Integer.parseInt(ns()) Integer.parseInt Integer ns() ns long nl() {
        return Long.parseLong(ns());
    } nl {
        return Long.parseLong(ns());
    } return Long.parseLong(ns()); Long.parseLong(ns()) Long.parseLong Long ns() ns double nd() {
        return Double.parseDouble(ns());
    } nd {
        return Double.parseDouble(ns());
    } return Double.parseDouble(ns()); Double.parseDouble(ns()) Double.parseDouble Double ns() ns void pl(String s) {
        System.out.println(s);
    } pl {
        System.out.println(s);
    } System.out.println(s) System.out.println System.out System System.out s String s s void pl(long s) {
        System.out.println(s);
    } pl {
        System.out.println(s);
    } System.out.println(s) System.out.println System.out System System.out s long s s void pl(double s) {
        System.out.println(s);
    } pl {
        System.out.println(s);
    } System.out.println(s) System.out.println System.out System System.out s double s s public class Main {
    BufferedReader br;
    StringTokenizer st;

    int max = -1;
    final long P = 998244353;
    final long P2 = 1000000007;

    HashSet<String> set = new HashSet<>();
    HashMap<Character, List<Integer>> map = new HashMap<>();

    // actual logic
    void solve() throws IOException {
        // int t = ni();
        // while (--t >= 0) {
        long a = nl();
        pl(a + a * a + a * a * a);
        // }

    }

    // constructor
    Main() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        } catch (Exception e) {
            System.out.println(e);
        }
    }

    Main(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
            st = new StringTokenizer(br.readLine());
        } catch (Exception e) {
            System.out.println(e);
        }
    }

    // main metohd
    public static void main(String[] args) throws IOException {
        new Main().solve();
    }

    // Utility methods

    String ns() {
        if (!st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        }
        return st.nextToken();

    }

    int ni() {
        return Integer.parseInt(ns());
    }

    long nl() {
        return Long.parseLong(ns());
    }

    double nd() {
        return Double.parseDouble(ns());
    }

    void pl(String s) {
        System.out.println(s);
    }

    void pl(long s) {
        System.out.println(s);
    }

    void pl(double s) {
        System.out.println(s);
    }
} public class Main {
    BufferedReader br;
    StringTokenizer st;

    int max = -1;
    final long P = 998244353;
    final long P2 = 1000000007;

    HashSet<String> set = new HashSet<>();
    HashMap<Character, List<Integer>> map = new HashMap<>();

    // actual logic
    void solve() throws IOException {
        // int t = ni();
        // while (--t >= 0) {
        long a = nl();
        pl(a + a * a + a * a * a);
        // }

    }

    // constructor
    Main() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        } catch (Exception e) {
            System.out.println(e);
        }
    }

    Main(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
            st = new StringTokenizer(br.readLine());
        } catch (Exception e) {
            System.out.println(e);
        }
    }

    // main metohd
    public static void main(String[] args) throws IOException {
        new Main().solve();
    }

    // Utility methods

    String ns() {
        if (!st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        }
        return st.nextToken();

    }

    int ni() {
        return Integer.parseInt(ns());
    }

    long nl() {
        return Long.parseLong(ns());
    }

    double nd() {
        return Double.parseDouble(ns());
    }

    void pl(String s) {
        System.out.println(s);
    }

    void pl(long s) {
        System.out.println(s);
    }

    void pl(double s) {
        System.out.println(s);
    }
} Main

// Java program For handling Input/Output 
import java.io.*;
import java.util.*;
import java.math.*;
//import java.awt.*;

public class Main {
    BufferedReader br;
    StringTokenizer st;

    int max = -1;
    final long P = 998244353;
    final long P2 = 1000000007;

    HashSet<String> set = new HashSet<>();
    HashMap<Character, List<Integer>> map = new HashMap<>();

    // actual logic
    void solve() throws IOException {
        // int t = ni();
        // while (--t >= 0) {
        long a = nl();
        pl(a + a * a + a * a * a);
        // }

    }

    // constructor
    Main() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        } catch (Exception e) {
            System.out.println(e);
        }
    }

    Main(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
            st = new StringTokenizer(br.readLine());
        } catch (Exception e) {
            System.out.println(e);
        }
    }

    // main metohd
    public static void main(String[] args) throws IOException {
        new Main().solve();
    }

    // Utility methods

    String ns() {
        if (!st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                System.out.println(e);
            }
        }
        return st.nextToken();

    }

    int ni() {
        return Integer.parseInt(ns());
    }

    long nl() {
        return Long.parseLong(ns());
    }

    double nd() {
        return Double.parseDouble(ns());
    }

    void pl(String s) {
        System.out.println(s);
    }

    void pl(long s) {
        System.out.println(s);
    }

    void pl(double s) {
        System.out.println(s);
    }
}
