import java.io.*;
import java.util.*;
public class Main {

public static void main(String[] args) {
    InputReader sc = new InputReader(System.in);
    PrintWriter pw = new PrintWriter(System.out);
    Random gen = new Random();
    int test = 1;//sc.nextInt();
    while(test-->0) {

        int n = sc.nextInt();
        long ans = n + n*n + n*n*n;
        pw.println(ans);

    }
    pw.close();

}



























































































































































































static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream st) {
        this.stream = st;
    }

    public int read() {
        if (snumChars == -1)
            throw new InputMismatchException();
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int [] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public static int[] shuffle(int[] a, Random gen)
    { for(int i = 0, n = a.length;i < n;i++)
    { int ind = gen.nextInt(n-i)+i;
        int d = a[i];
        a[i] = a[ind];
        a[ind] = d;

    }
        return a;
    }


    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

} import java.io.*; io.* java import java.util.*; util.* java public class Main {

public static void main(String[] args) {
    InputReader sc = new InputReader(System.in);
    PrintWriter pw = new PrintWriter(System.out);
    Random gen = new Random();
    int test = 1;//sc.nextInt();
    while(test-->0) {

        int n = sc.nextInt();
        long ans = n + n*n + n*n*n;
        pw.println(ans);

    }
    pw.close();

}



























































































































































































static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream st) {
        this.stream = st;
    }

    public int read() {
        if (snumChars == -1)
            throw new InputMismatchException();
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int [] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public static int[] shuffle(int[] a, Random gen)
    { for(int i = 0, n = a.length;i < n;i++)
    { int ind = gen.nextInt(n-i)+i;
        int d = a[i];
        a[i] = a[ind];
        a[ind] = d;

    }
        return a;
    }


    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

} Main public static void main(String[] args) {
    InputReader sc = new InputReader(System.in);
    PrintWriter pw = new PrintWriter(System.out);
    Random gen = new Random();
    int test = 1;//sc.nextInt();
    while(test-->0) {

        int n = sc.nextInt();
        long ans = n + n*n + n*n*n;
        pw.println(ans);

    }
    pw.close();

} main {
    InputReader sc = new InputReader(System.in);
    PrintWriter pw = new PrintWriter(System.out);
    Random gen = new Random();
    int test = 1;//sc.nextInt();
    while(test-->0) {

        int n = sc.nextInt();
        long ans = n + n*n + n*n*n;
        pw.println(ans);

    }
    pw.close();

} InputReader sc = new InputReader(System.in); sc new InputReader(System.in) PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) Random gen = new Random(); gen new Random() int test = 1; test 1 while(test-->0) {

        int n = sc.nextInt();
        long ans = n + n*n + n*n*n;
        pw.println(ans);

    } test-->0 test-- test 0 {

        int n = sc.nextInt();
        long ans = n + n*n + n*n*n;
        pw.println(ans);

    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long ans = n + n*n + n*n*n; ans 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 pw.println(ans) pw.println pw ans pw.close() pw.close pw String[] args args static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream st) {
        this.stream = st;
    }

    public int read() {
        if (snumChars == -1)
            throw new InputMismatchException();
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int [] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public static int[] shuffle(int[] a, Random gen)
    { for(int i = 0, n = a.length;i < n;i++)
    { int ind = gen.nextInt(n-i)+i;
        int d = a[i];
        a[i] = a[ind];
        a[ind] = d;

    }
        return a;
    }


    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

} InputReader private final InputStream stream; stream private final byte[] buf = new byte[8192]; buf new byte[8192] 8192 private int curChar curChar snumChars; snumChars public InputReader(InputStream st) {
        this.stream = st;
    } InputReader {
        this.stream = st;
    } this.stream = st this.stream this this.stream st InputStream st st public int read() {
        if (snumChars == -1)
            throw new InputMismatchException();
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        }
        return buf[curChar++];
    } read {
        if (snumChars == -1)
            throw new InputMismatchException();
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        }
        return buf[curChar++];
    } if (snumChars == -1)
            throw new InputMismatchException(); snumChars == -1 snumChars -1 1 throw new InputMismatchException(); new InputMismatchException() if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        } curChar >= snumChars curChar snumChars {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        } curChar = 0 curChar 0 try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            } catch (IOException e) {
                throw new InputMismatchException();
            } IOException e {
                throw new InputMismatchException();
            } throw new InputMismatchException(); new InputMismatchException() {
                snumChars = stream.read(buf);
            } snumChars = stream.read(buf) snumChars stream.read(buf) stream.read stream buf if (snumChars <= 0)
                return -1; snumChars <= 0 snumChars 0 return -1; -1 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    } nextInt {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    } int c = read(); c read() read while (isSpaceChar(c)) {
            c = read();
        } isSpaceChar(c) isSpaceChar c {
            c = read();
        } c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
            sgn = -1;
            c = read();
        } c == '-' c '-' {
            sgn = -1;
            c = read();
        } sgn = -1 sgn -1 1 c = read() c read() read int res = 0; res 0 do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
            res *= 10;
            res += c - '0';
            c = read();
        } res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    } nextLong {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    } int c = read(); c read() read while (isSpaceChar(c)) {
            c = read();
        } isSpaceChar(c) isSpaceChar c {
            c = read();
        } c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
            sgn = -1;
            c = read();
        } c == '-' c '-' {
            sgn = -1;
            c = read();
        } sgn = -1 sgn -1 1 c = read() c read() read long res = 0; res 0 do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
            res *= 10;
            res += c - '0';
            c = read();
        } res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public int[] nextIntArray(int n) {
        int [] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    } nextIntArray {
        int [] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    } int [] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = nextInt();
        } {
            a[i] = nextInt();
        } a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n public static int[] shuffle(int[] a, Random gen)
    { for(int i = 0, n = a.length;i < n;i++)
    { int ind = gen.nextInt(n-i)+i;
        int d = a[i];
        a[i] = a[ind];
        a[ind] = d;

    }
        return a;
    } shuffle { for(int i = 0, n = a.length;i < n;i++)
    { int ind = gen.nextInt(n-i)+i;
        int d = a[i];
        a[i] = a[ind];
        a[ind] = d;

    }
        return a;
    } for(int i = 0, n = a.length;i < n;i++)
    { int ind = gen.nextInt(n-i)+i;
        int d = a[i];
        a[i] = a[ind];
        a[ind] = d;

    } int i = 0, n = a.length; int i = 0 i 0 n = a.length; n a.length a a.length i < n i n i++ i++ i { int ind = gen.nextInt(n-i)+i;
        int d = a[i];
        a[i] = a[ind];
        a[ind] = d;

    } { int ind = gen.nextInt(n-i)+i;
        int d = a[i];
        a[i] = a[ind];
        a[ind] = d;

    } int ind = gen.nextInt(n-i)+i; ind gen.nextInt(n-i)+i gen.nextInt(n-i) gen.nextInt gen n-i n i i int d = a[i]; d a[i] a i a[i] = a[ind] a[i] a i a[ind] a ind a[ind] = d a[ind] a ind d return a; a int[] a a Random gen gen public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    } readString {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    } int c = read(); c read() read while (isSpaceChar(c)) {
            c = read();
        } isSpaceChar(c) isSpaceChar c {
            c = read();
        } c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
            res.appendCodePoint(c);
            c = read();
        } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res public String nextLine() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    } nextLine {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    } int c = read(); c read() read while (isSpaceChar(c))
            c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c)); !isEndOfLine(c) isEndOfLine(c) isEndOfLine c {
            res.appendCodePoint(c);
            c = read();
        } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    } isSpaceChar {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    } return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == '\t' c == '\r' c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == ' ' c ' ' c == '\n' c '\n' c == '\r' c '\r' c == '\t' c '\t' c == -1 c -1 1 int c c private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    } isEndOfLine {
        return c == '\n' || c == '\r' || c == -1;
    } return c == '\n' || c == '\r' || c == -1; c == '\n' || c == '\r' || c == -1 c == '\n' || c == '\r' || c == -1 c == '\n' c '\n' c == '\r' c '\r' c == -1 c -1 1 int c c public class Main {

public static void main(String[] args) {
    InputReader sc = new InputReader(System.in);
    PrintWriter pw = new PrintWriter(System.out);
    Random gen = new Random();
    int test = 1;//sc.nextInt();
    while(test-->0) {

        int n = sc.nextInt();
        long ans = n + n*n + n*n*n;
        pw.println(ans);

    }
    pw.close();

}



























































































































































































static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream st) {
        this.stream = st;
    }

    public int read() {
        if (snumChars == -1)
            throw new InputMismatchException();
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int [] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public static int[] shuffle(int[] a, Random gen)
    { for(int i = 0, n = a.length;i < n;i++)
    { int ind = gen.nextInt(n-i)+i;
        int d = a[i];
        a[i] = a[ind];
        a[ind] = d;

    }
        return a;
    }


    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

} public class Main {

public static void main(String[] args) {
    InputReader sc = new InputReader(System.in);
    PrintWriter pw = new PrintWriter(System.out);
    Random gen = new Random();
    int test = 1;//sc.nextInt();
    while(test-->0) {

        int n = sc.nextInt();
        long ans = n + n*n + n*n*n;
        pw.println(ans);

    }
    pw.close();

}



























































































































































































static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream st) {
        this.stream = st;
    }

    public int read() {
        if (snumChars == -1)
            throw new InputMismatchException();
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int [] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public static int[] shuffle(int[] a, Random gen)
    { for(int i = 0, n = a.length;i < n;i++)
    { int ind = gen.nextInt(n-i)+i;
        int d = a[i];
        a[i] = a[ind];
        a[ind] = d;

    }
        return a;
    }


    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

} Main
import java.io.*;
import java.util.*;
public class Main {

public static void main(String[] args) {
    InputReader sc = new InputReader(System.in);
    PrintWriter pw = new PrintWriter(System.out);
    Random gen = new Random();
    int test = 1;//sc.nextInt();
    while(test-->0) {

        int n = sc.nextInt();
        long ans = n + n*n + n*n*n;
        pw.println(ans);

    }
    pw.close();

}



























































































































































































static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream st) {
        this.stream = st;
    }

    public int read() {
        if (snumChars == -1)
            throw new InputMismatchException();
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int [] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public static int[] shuffle(int[] a, Random gen)
    { for(int i = 0, n = a.length;i < n;i++)
    { int ind = gen.nextInt(n-i)+i;
        int d = a[i];
        a[i] = a[ind];
        a[ind] = d;

    }
        return a;
    }


    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

}