Recently, Norge found a string s = s_1 s_2 … s_n consisting of n lowercase Latin letters. As an exercise to improve his typing speed, he decided to type all substrings of the string s. Yes, all (n (n + 1))/(2) of them!

A substring of s is a non-empty string x = s[a … b] = s_{a} s_{a + 1} … s_{b} (1 ≤ a ≤ b ≤ n). For example, "auto" and "ton" are substrings of "automaton".

Shortly after the start of the exercise, Norge realized that his keyboard was broken, namely, he could use only k Latin letters c_1, c_2, …, c_k out of 26.

After that, Norge became interested in how many substrings of the string s he could still type using his broken keyboard. Help him to find this number.

Input

The first line contains two space-separated integers n and k (1 ≤ n ≤ 2 ⋅ 10^5, 1 ≤ k ≤ 26) — the length of the string s and the number of Latin letters still available on the keyboard.

The second line contains the string s consisting of exactly n lowercase Latin letters.

The third line contains k space-separated distinct lowercase Latin letters c_1, c_2, …, c_k — the letters still available on the keyboard.

Output

Print a single number — the number of substrings of s that can be typed using only available letters c_1, c_2, …, c_k.

Examples

Input


7 2
abacaba
a b


Output


12


Input


10 3
sadfaasdda
f a d


Output


21


Input


7 1
aaaaaaa
b


Output


0

Note

In the first example Norge can print substrings s[1…2], s[2…3], s[1…3], s[1…1], s[2…2], s[3…3], s[5…6], s[6…7], s[5…7], s[5…5], s[6…6], s[7…7].
"""
s = input()
l=[]
i=0
lens = len(s)
while(i<len(s)):
    l.append(s[i:i+2])
    i+=2
len1 = len(l)
if len1==1:
    print("NO")
else:
    if lens%2==0:
        if "AB" in l and "BA" in l:
            print("YES")
        else:
            print("NO")
    else:

        if "AB" in l and "BA" in l:
            print("YES")
        else:
           # print(l)
            if "AB" in l and "BA" not in l:
                if s.find("AB")!=lens-3:
                    s=""
                    s+=l[len1-2][1]+l[len1-1]
                    if s=="BA":
                        print("YES")
                    else:
                        print("NO")
                else:
                    print("NO")
            elif "BA" in l and "AB" not in l:
                if s.find("BA")!=lens-3:
                    s=""
                    s+=l[len1-2][1]+l[len1-1]
                    if s=="AB":
                        print("YES")
                    else:
                        print("NO")
                else:
                    print("NO")
            else:
                print("NO")
"""
"""
s = input()
ab=s.find("AB")
ba = s.find("BA")
if s.find("BA",ab+2)!=-1 and ab!=-1:
    print("YES")
elif s.find("AB",ba+2)!=-1 and ba!=-1:
    print("YES")
else:
    print("NO")
"""

"""
n,m = map(int,input().split())
if m%2!=0:
    l=[(m+1)//2]
    for i in range(1,(m+1)//2):
        l.append((m+1)//2 - i)
        l.append((m+1)//2 + i)
else:
    if m==2:
        l=[1,2]
    else:
        l=[m//2]
        for i in range(1,m//2):
            l.append(m//2+i)
            l.append(m//2-i)
        l.append(m)
ans = l*(n//len(l))
ans+=l[0:n%len(l)]
for i in range(n):
    print(ans[i])
"""
"""
def main():
    t = int(input())
    for _ in range(t):
        n = int(input())
        n = str(n)
        n= list(n)[::-1]
        i=0
        while(i<len(n)):
            if n[i]=="0":
                n.remove(n[i])
            else:
                break
        print("".join(n))
if __name__ == '__main__':
    main()
"""
"""
t = int(input())
for _ in range(t):
    s = input()
    if len(s)%2==0:
        q = s[:len(s)//2]
        t = s[len(s)//2:]
        q = sorted(list(q))
        t = sorted((list(t)))
        if q==t:
            print("YES")
        else:
            print("NO")
    else:
        q = s[0:len(s) // 2]
        t = s[len(s) // 2 +1:]
        q = sorted(list(q))
        t = sorted((list(t)))
        if q == t:
            print("YES")
        else:
            print("NO")
"""
import sys
input = sys.stdin.readline
"""
n= int(input())
l=[]
for _ in range(n):
    p = int(input())
    l.append(p)
l.sort()
s=[]
for i in range(n):
    s.append(l[i]*(n-i))
#print(s)
print(max(s))
"""
"""
t = int(input())
for _ in range(t):
    n = int(input())
    s = list(map(int,input().split()))
    cnt=1
    for i in range(len(s)-1):
        #print(s[i])
        if s[i]>=s[i+1]:
            cnt+=1
        else:
            s[i+1]=s[i]
    print(cnt)
"""


# Python3 program to
# count trailing 0s
# in n!

# Function to return
# trailing 0s in
# factorial of n


def findTrailingZeros(n):
    # Initialize result
    cnt = 0

    # Keep dividing n by
    # 5 & update Count
    while (n >= 5):
        n //= 5
        cnt += n

    return cnt
"""
def main():
    t = int(input())
    for _ in range(t):
        s = input()
        l = s.count("L")
        r = s.count("R")
        d = s.count("D")
        u = s.count("U")
        ll=min(l,r)
        uu=min(u,d)
        if ll==0 and uu==0:
            print(0)
            print()
        elif ll==0:
            print(2)
            print("UD")
        elif uu==0:
            print(2)
            print("LR")
        else:
            print(ll+uu+ll+uu)
            print("U"*uu+"L"*ll+"D"*uu+"R"*ll)
if __name__ == '__main__':
    main()
"""
def main():
    n,k = map(int,input().split())
    s=input()
    c = list(map(str,input().split()))
    l=[]
    cnt=0
    for i in s:
        if i not in c:

            l.append(cnt)
            cnt=0
        else:
            cnt+=1
    ans=0
    for i in l:
        ans+=(i*(i+1)//2)
    print(ans)
if __name__ == '__main__':
    main()
