Господа, я повис напрочь. Как решить это?
This problem can be solved by pre-school children in five to ten minutes, by programmers in an hour and by people with higher education... well, check it yourself!
8809	=	6	5555	=	0
7111	=	0	8193	=	3
2172	=	0	8096	=	5
6666	=	4	1012	=	1
1111	=	0	7777	=	0
3213	=	0	9999	=	4
7662	=	2	7756	=	1