import java.util.Scanner;
 
public class Main { //クラス名はMain
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
      int K = in.nextInt();
      int A = K + K*K + K*K*K;
     
       
            System.out.println(A);
     
    }
} import java.util.Scanner; Scanner java.util public class Main { //クラス名はMain
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
      int K = in.nextInt();
      int A = K + K*K + K*K*K;
     
       
            System.out.println(A);
     
    }
} Main public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
      int K = in.nextInt();
      int A = K + K*K + K*K*K;
     
       
            System.out.println(A);
     
    } main {
    Scanner in = new Scanner(System.in);
      int K = in.nextInt();
      int A = K + K*K + K*K*K;
     
       
            System.out.println(A);
     
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int K = in.nextInt(); K in.nextInt() in.nextInt in int A = K + K*K + K*K*K; A K + K*K + K*K*K K + K*K + K*K*K K K*K K K K*K*K K*K*K K K K System.out.println(A) System.out.println System.out System System.out A String[] args args public class Main { //クラス名はMain
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
      int K = in.nextInt();
      int A = K + K*K + K*K*K;
     
       
            System.out.println(A);
     
    }
} public class Main { //クラス名はMain
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
      int K = in.nextInt();
      int A = K + K*K + K*K*K;
     
       
            System.out.println(A);
     
    }
} Main
import java.util.Scanner;
 
public class Main { //クラス名はMain
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
      int K = in.nextInt();
      int A = K + K*K + K*K*K;
     
       
            System.out.println(A);
     
    }
}