      program euler6

      implicit none
      character (len = 100) :: file_name  
      integer, parameter :: big = selected_int_kind(11)
      integer (kind = big)  :: n,ans
      call getarg( 1, file_name )  
      OPEN(unit = 7, file = file_name)
      read (7,*) n
      
      ans = ((n * (n + 1))/2)**2 - ((n * (n + 1) * (1 + ( 2 * n)))/6) 

      write (unit = *, fmt = "(I0)") ans




      end program euler6
