#오답
whole, part = map(int, input().split())
DNA = str(input())
A,C,G,T = map(int, input().split())
Acount = 0
Ccount = 0
Gcount = 0
Tcount = 0
AvailableCount = 0
for i in range(whole-part):
k = i + part
for k in range(part+k):
if DNA[i]=="A": Acount +=1
elif DNA[i]=="C": Ccount +=1
elif DNA[i]=="G": Gcount +=1
elif DNA[i]=="T": Tcount +=1
if Acount >= A and Ccount >=C and Gcount >=G and Tcount >=T :
AvailableCount +=1
print(AvailableCount)
checkList = [0]*4
myList = [0]*4
checkSecret = 0
#문자 체크해서 갯수 넣어주는 4개 칸 배열
def myadd(c):
global checkList,myList,checkSecret
if c == 'A':
myList[0] +=1
if myList[0] == checkList[0]:
checkSecret += 1
elif c == 'C':
myList[1] += 1
if myList[1] == checkList[1]:
checkSecret += 1
elif c == 'G':
myList[2] += 1
if myList[2] == checkList[2]:
checkSecret += 1
elif c == 'T':
myList[3] += 1
if myList[3] == checkList[3]:
checkSecret += 1
#제거 문자 처리 함수
def myremove(c):
global checkList, myList, checkSecret
if c == 'A':
if myList[0] == checkList[0]:
checkSecret -=1
myList[0] -=1
if c == 'C':
if myList[1] == checkList[1]:
checkSecret -=1
myList[1] -=1
if c == 'G':
if myList[2] == checkList[2]:
checkSecret -=1
myList[2] -=1
if c == 'T':
if myList[3] == checkList[3]:
checkSecret -=1
myList[3] -=1
S,P = map (int, input().split())
Result = 0
A = list(input())
checkList = list(map(int, input().split()))
for i in range(4):
if checkList[i] == 0:
checkSecret +=1
for i in range(P):
myadd(A[i])
if checkSecret == 4:
Result += 1
for i in range(P,S):
j = i - P
myadd(A[i])
myremove(A[j])
if checkSecret == 4:
Result += 1
print(Result)