program writing;
type
arr=array['A'..'z']of longint;
var l1,l2:longint;
a,b:arr;
f:text;
n:array[1..3000000]of char;
ans:longint;
function check:boolean;
var i:char;
begin
check:=false;
for i:='A'to 'Z' do
if a[i]<>b[i] then exit;
for i:='a'to 'z' do
if a[i]<>b[i] then exit;
check:=true;
end;
procedure init;
var i,j:longint;
c:char;
begin
assign(f,'writing.in');reset(f);
readln(f,l1,l2);
for i:=1 to l1 do
begin read(f,c);inc(a[c]);end;
readln(f);
for i:=1 to l1 do
begin read(f,c);inc(b[c]);n[i]:=c;end;
if check then ans:=1 else ans:=0;
for i:=l1+1 to l2 do
begin
read(f,c);n[i]:=c;inc(b[c]);
dec(b[n[i-l1]]);
if check then ans:=ans+1;
end;
close(f);
assign(f,'writing.out');rewrite(f);
writeln(f,ans);close(f);
end;
Begin
init;
end.