var
s1, s2: string;
i, j, count: byte;
p: boolean;
BEGIN
count:=0; i:=0;
write('S1: '); readln(s1);
write('S2: '); readln(s2);
while (i<=length(s1)) do
begin
p:=false; i:=i+1;
if (s1[i]=s2[1]) then
begin
p:=true;
for j:=2 to length(s2) do
begin
i:=i+1;
if (s1[i]=s2[j]) then p:=true
else p:=false;
end; if p then count:=count+1;
end;
end;
writeln(count);
END.