program probD
  implicit none
  integer(8) :: n
  integer(16), allocatable :: f(:)
  integer(8) :: i, j

  
  read(*,*) n
  allocate(f(n))
  
  do i = 1, n
     do j = i, n, i
        f(j) = f(j) + j
     end do
  end do
  
  write(*,*) sum(f)
  stop
end program probD
