program atcoder
implicit none
integer :: n , x , y , z , i , sum
real :: j
read *,n
sum = 0
j = real(n)
do i = 1 , n
  sum = 0
  do x = 1 , int(sqrt(j/6.0))+1
    do y = x , int(sqrt(j))+1
      do z = y , int(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)goto 10
        end if
      end do
    end do
  end do
  print *, sum * 3
  goto 20
10 print *, sum * 3 - 2
20 end do
end program atcoder
