      PROGRAM piyo
      IMPLICIT NONE
      INTEGER,PARAMETER :: p = 16
      integer(p) :: a
      
      read*,a
      
      print'(i0)',a + a**2 + a**3
      
      
      
      
      stop
      !debugg
      
      
      
      END PROGRAM