//Huh, if my Master wants. var s,s1,s2:string; begin; write('String:'); readln(s); write('Substring:'); readln(s1); if length(s1)<>1 then exit; while pos(s1,s)<>0 do begin; s2:=s2+s[pos(s1,s)]; delete(s,pos(s1,s),1); end; write('Result:',length(s2)); end.
var s,s1,s2:string;
begin;
write('String:');
readln(s);
write('Substring:');
readln(s1);
if length(s1)<>1 then exit;
while pos(s1,s)<>0 do
begin;
s2:=s2+s[pos(s1,s)];
delete(s,pos(s1,s),1);
end;
write('Result:',length(s2));
end.