I saw this puzzle many moons ago and so I assumed it would already be on here somewhere. I have looked and not found, though, and so I present to you a puzzle that baffled me when first I saw it.
What number replaces the question mark in the last example and why?
3531 → 0
3597 → 1
3891 → 3
9397 → 2
3869 → 4
2128 → 2
3786 → 3
3506 → 2
2700 → 2
7212 → 0
7205 → 1
2990 → 3
9503 → 2
1057 → 1
1160 → 2
1995 → ?