program ooo;
var
t:text;
a,b:array[1..70] of longint;
q:array[1..3000000] of longint;
i,j,k,l,n,m,sum:longint;
c:char;
begin
assign(t,'writing.in');
reset(t);
readln(t,n,m);
for i:=1 to n do
begin
read(t,c);
if c>='a' then
begin
j:=ord(c)-ord('a')+27;
inc(a[j]);
end else
begin
j:=ord(c)-ord('A')+1;
inc(a[j]);
end;
end;
readln(t);
for i:=1 to m do
begin
read(t,c);
if c>='a' then
begin
j:=ord(c)-ord('a')+27;
q[i]:=j;
end else
begin
j:=ord(c)-ord('A')+1;
q[i]:=j;
end;
end;
i:=1;
close(t);
while i<=m-n+1 do
begin
for j:=i to m do
if (b[q[j]]+1<=a[q[j]])and(k+1<=n) then
begin
inc(k);
inc(b[q[j]]);
end else
if b[q[j]]+1>a[q[j]] then
begin
if k=n then
begin
inc(sum);
i:=i+1;
fillchar(b,sizeof(b),0);
k:=0;
break;
end else begin
i:=i+1;
fillchar(b,sizeof(b),0);
k:=0;
break;
end;
end;
end;
assign(t,'writing.out');
rewrite(t);
write(t,sum);
close(t);
end.