
import java.util.*;
 public class Main {
    public static void main(String[] args) {
        Scanner sc = new  Scanner(System.in);
        int t = sc.nextInt();

  System.out.println(t+(t*t)+(t*t*t));
  
      
        
    


}

    }
     import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new  Scanner(System.in);
        int t = sc.nextInt();

  System.out.println(t+(t*t)+(t*t*t));
  
      
        
    


}

    } Main public static void main(String[] args) {
        Scanner sc = new  Scanner(System.in);
        int t = sc.nextInt();

  System.out.println(t+(t*t)+(t*t*t));
  
      
        
    


} main {
        Scanner sc = new  Scanner(System.in);
        int t = sc.nextInt();

  System.out.println(t+(t*t)+(t*t*t));
  
      
        
    


} Scanner sc = new  Scanner(System.in); sc new  Scanner(System.in) int t = sc.nextInt(); t sc.nextInt() sc.nextInt sc System.out.println(t+(t*t)+(t*t*t)) System.out.println System.out System System.out t+(t*t)+(t*t*t) t+(t*t)+(t*t*t) t (t*t) t t (t*t*t) t*t*t t t t String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new  Scanner(System.in);
        int t = sc.nextInt();

  System.out.println(t+(t*t)+(t*t*t));
  
      
        
    


}

    } public class Main {
    public static void main(String[] args) {
        Scanner sc = new  Scanner(System.in);
        int t = sc.nextInt();

  System.out.println(t+(t*t)+(t*t*t));
  
      
        
    


}

    } Main

import java.util.*;
 public class Main {
    public static void main(String[] args) {
        Scanner sc = new  Scanner(System.in);
        int t = sc.nextInt();

  System.out.println(t+(t*t)+(t*t*t));
  
      
        
    


}

    }
    
