var s:string;i:integer;c:char;beginreadln(s);readln(c);while pos(c,s)<>0 do begininc(i);delete(s,pos(c,s),1);end;writeln(i);end.
var s:string;
i:integer;
c:char;
begin
readln(s);
readln(c);
while pos(c,s)<>0 do begin
inc(i);
delete(s,pos(c,s),1);
end;
writeln(i);
end.