uses crt;
var N:longint;
A,k,cf:byte;
begin
clrscr;
write('N=');readln(N);
repeat
write('A=');
readln(A);
until (A>=0)and(A<9);
k:=0;
while N>0 do
begin
cf:=N mod 10;
if cf>A then k:=k+1;
N:=N div 10;
end;
writeln('Kolichestvo cifr bolshe A = ',k);
readln
end.