program t1(input,output);
var
temp,data:array[1..52]of longint;
i,j,s,g,ans:longint; ch:char;
str:array[1..3000000]of integer;
function deal(x:char):integer;
begin
if ord(x)<ord('a')
then
deal:=ord(x)-ord('A')+1
else
deal:=ord(x)-ord('a')+1+26;
end;
function check:boolean;
var
i:integer;
begin
check:=false;
for i:= 1 to 52 do
if temp[i]<>data[i] then exit;
check:=true;
end;
begin
fillchar(temp,sizeof(temp),0);
fillchar(data,sizeof(data),0);
fillchar(str,sizeof(str),0);
ans:=0;
assign(input,'writing.in');
reset(input);
readln(input,g,s);
for i:= 1 to g do
begin
read(input,ch);
inc(data[deal(ch)] ) ;
end;
readln(input);
for i:= 1 to s do
begin
read(input,ch);
str[i]:=deal(ch);
end;
close(input);
for i:= 1 to g do
begin
inc(temp[str[i]]);
end;
if check then inc(ans);
for i:=g+1 to s do
begin
dec(temp[str[i-g]]);
inc(temp[str[i]]);
if check then inc(ans);
end;
assign(output,'writing.out');
rewrite(output);
write(output,ans);
close(output);
end.