Simplicity Power

The following problem is offered to kids admitted to kindergarten or first-grade in some of the Ukrainian schools. I couldn’t solve this problem immediately, had to look for a solution. For readers of this post I’ll let out a small hint – the problem is much simpler then you first think.

8809 = 6
7111 = 0
2172 = 0
6666 = 4
1111 = 0
3213 = 0
7662 = 2
9312 = 1
0000 = 4
2222 = 0
3333 = 0
5555 = 0
8193 = 3
8096 = 5
7777 = 0
9999 = 4
7756 = 1
6855 = 3
9881 = 5
5531 = 0

2581 = ?

If you really must know the solution -I’ll post it tomorrow.