program tsundoku
  implicit none
  integer :: n, m, i,j, h = 0, l, r, p
  integer(8) :: k, t
  integer(8), dimension(0:200001) :: a = 0, b = 0,c=0, x = 0, y = 0
  read(*,*) n
    do t=1,n
    m=int(sqrt(dble(t)))
    p=0
	do i=1,m
    	do j=1,m-i
        	do k=1,m-j
            	if((i+j)*(i+j)+(i+k)*(i+k)+(k+j)*(k+j)==2*t)then
                p=p+1
                end if
            end do
        end do
    end do
    write(*,*)p
    end do
end program tsundoku