var
n,p,i,total:longint;
ch:char;
f,b:array['A'..'z']of longint;
s:array[0..3000000]of char;
function yes:boolean;
var
i:longint;
j:char;
begin
for j:='A' to 'z' do
if f[j]<>b[j] then exit(false);
exit(true);
end;
begin
assign(input,'writing.in'); reset(input);
assign(output,'writing.out'); rewrite(output);
readln(p,n);
for i:=1 to p do
begin
read(ch);
inc(b[ch]);
end;
readln;
for i:=1 to p do
begin
read(s[i]);
inc(f[s[i]]);
end;
if yes then inc(total);
for i:=p+1 to n do
begin
read(s[i]);
inc(f[s[i]]);
dec(f[s[i-p]]);
if yes then inc(total);
end;
writeln(total);
close(input);
close(output);
end.