program task_d;
var count_sym, i, counter: integer;
n,n_1, p,r:string;
begin
readln(p);
readln(r);
count_sym := 1;
counter := 1;
for i:=1 to length(r) do
begin
n := Copy(r, i, count_sym);
n_1 := Copy(r, i, count_sym+1);
if (Pos(n, p)<>0 ) and (Pos(n_1, p)=0) then
begin
count_sym := 1;
counter:=counter+1;
end
else count_sym := count_sym+1;
end;
writeln(counter);
end.
cHJvZ3JhbSB0YXNrX2Q7CnZhciBjb3VudF9zeW0sIGksIGNvdW50ZXI6IGludGVnZXI7Cm4sbl8xLCBwLHI6c3RyaW5nOwpiZWdpbgpyZWFkbG4ocCk7CnJlYWRsbihyKTsKY291bnRfc3ltIDo9IDE7CmNvdW50ZXIgIDo9IDE7CmZvciBpOj0xIHRvIGxlbmd0aChyKSBkbwpiZWdpbgogICAgIG4gOj0gQ29weShyLCBpLCBjb3VudF9zeW0pOwogICAgIG5fMSA6PSAgQ29weShyLCBpLCBjb3VudF9zeW0rMSk7CiAgICAgaWYgKFBvcyhuLCBwKTw+MCApIGFuZCAoUG9zKG5fMSwgcCk9MCkgdGhlbgogICAgICAgIGJlZ2luCiAgICAgICAgY291bnRfc3ltIDo9IDE7CiAgICAgICAgY291bnRlcjo9Y291bnRlcisxOwogICAgICAgIGVuZAogICAgIGVsc2UgY291bnRfc3ltIDo9IGNvdW50X3N5bSsxOwogCmVuZDsKIAp3cml0ZWxuKGNvdW50ZXIpOwplbmQu