Program z1; uses crt; var chyslo,a,b,c,d,k:integer; t1,t2:text; begin clrscr; assign(t1,'c:\count.in'); reset(t1); read(t1,chyslo); close(t1); a:=(chyslo mod 10000 div 1000); b:=(chyslo mod 1000 div 100); c:=(chyslo mod 100 div 10); d:=(chyslo mod 10 div 1); if(a=b)or (a=c) or(a=d) then k:=1; if(b=a)or (b=c) or(b=d) then k:=k+1; if(c=a)or (c=b) or(c=d) then k:=k+1; if(d=a)or (d=c) or(d=b) then k:=k+1; assign(t2,'c:\count.out'); rewrite(t2); write(t2,k); close(t2); readln; end.