program writing(input,output);
type
arr=array['A'..'z']of longint;
var
i,l1,l2,ans,len:longint;
ch:char;
a,b:arr;
sym:array[1..3000000]of char;
function same:boolean;
var
i:char;
begin
for i:='A' to 'Z' do
if a[i]<>b[i] then
exit(false);
for i:='a' to 'z' do
if a[i]<>b[i] then
exit(false);
exit(true);
end;
begin
assign(input,'writing.in');
reset(input);
assign(output,'writing.out');
rewrite(output);
readln(l1,l2);
for i:=1 to l1 do
begin
read(ch);
inc(a[ch]);
end;
readln;
for i:=1 to l1 do
begin
read(ch);
inc(b[ch]);
inc(len);
sym[len]:=ch;
end;
if same then
ans:=1;
for i:=l1+1 to l2 do
begin
read(ch);
inc(len);
sym[len]:=ch;
inc(b[ch]);
dec(b[sym[len-l1]]);
if same then
inc(ans);
end;
writeln(ans);
close(input);
close(output);
end.