Python 2, 44 bytes
f=lambda n,x=1:+(x>n)or(n%x<1)-f(n,x+2)/4<<2
This is almost the same as xsot's solutionsolution (which is based on Peter Taylor's solutionsolution), but saves 8 bytes by simplifying the way signs are handled.
Note that for a full program, we can save 2 bytes in the function without incurring a cost outside the function:
f=lambda n,x=1:x>n or(n%x<1)-f(n,x+2)/4<<2
print+f(input())
Two additional bytes for a full program this way:
n=input()
f=lambda x:x>n or(n%x<1)-f(x+2)/4<<2
print+f(1)
For n > 0
there is a very legible 40-byte solution:
f=lambda n,x=1:n/x and(n%x<1)*4-f(n,x+2)