program atcoder
implicit none
integer :: n , x , y , z , i , sum , num
real :: j
read *,n
sum = 0
num = 0
j = real(n)
do i = 1 , n
  sum = 0
  num = 0
  do x = 1 , nint(sqrt(j/6.0))
    do y = x , nint(sqrt(j/3.0))+1
      do z = y , nint(sqrt(j))+1
        if(x**2 + y**2 + z**2 + x*y + y*z + z*x == i)then
          sum = sum + 1
          if(x == y .and. y == z)then
            num = num + 1
          end if
        end if
      end do
    end do
  end do
  print *, sum *  3 - num * 2
end do
end program atcoder