Recently, Norge found a string $s = s_1 s_2 \ldots 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 $\frac{n (n + 1)}{2}$ of them!

A substring of $s$ is a non-empty string $x = s[a \ldots b] = s_{a} s_{a + 1} \ldots s_{b}$ ($1 \leq a \leq b \leq 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, \ldots, 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 \leq n \leq 2 \cdot 10^5$, $1 \leq k \leq 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, \ldots, 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, \ldots, 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\ldots2]$, $s[2\ldots3]$, $s[1\ldots3]$, $s[1\ldots1]$, $s[2\ldots2]$, $s[3\ldots3]$, $s[5\ldots6]$, $s[6\ldots7]$, $s[5\ldots7]$, $s[5\ldots5]$, $s[6\ldots6]$, $s[7\ldots7]$.
[{"code": "n, k = map(int, input().split())\ns = set()\nst = input()\ninp = input().split()\nfor x in inp:\n    s.add(x)\ncurrent, ans = 0, 0\nfor x in st:\n    if x in s:\n        current += 1\n    else:\n        ans += (current * (current + 1)) // 2\n        current = 0\nans += (current * (current + 1)) // 2\nprint(ans)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "n,k=map(int,input().split())\ns=input()\nans1=0\nans=0\na=list(input())\nfor i in range(n):\n    if s[i] in a:\n        ans+=1\n    else:\n        ans1+=(ans*(ans+1)//2)\n        ans=0\nans1+=(ans*(ans+1))//2        \nprint(ans1)        ", "passed": true, "time": 0.23, "memory": 14288.0, "status": "done"}, {"code": "import sys\nimport math\nn, k = list(map(int, input().split()))\ns = list(input())\nword = set((input().split()))\nlenArr = []\nsum = 0\nfor i in range(len(s)):\n    if s[i] not in word:\n        if sum != 0:\n            lenArr.append(sum)\n            sum = 0\n    else:\n        sum += 1\n\nif sum != 0:\n    lenArr.append(sum)\n    sum = 0\n\nans = 0\nfor i in range(len(lenArr)):\n    ans += (lenArr[i] * (lenArr[i]+1)) // 2\nprint(ans)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "import sys\n\nn, k = map(int, sys.stdin.readline().strip().split(' '))\ns = sys.stdin.readline().strip()\nletters = sys.stdin.readline().strip().split(' ')\n\n#print(n, k, s, letters)\n#print(len(s))\n\ncurrent_counter = 0\nresult = 0\nfor c in s:\n\tif c in letters:\n\t\tcurrent_counter += 1\n\telse:\n\t\tresult += current_counter * (current_counter + 1) // 2\n\t\tcurrent_counter = 0\n\nresult += current_counter * (current_counter + 1) // 2\nprint(result)", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "def f(n):\n    return n*(n+1)//2\na,m = map(int,input().split())\ns = list(input())\nt = set(input().split())\np = 0\ni = 0\nans = 0\nwhile p<len(s):\n    if s[p] not in t:\n        ans+=f(i)\n        i = 0\n    else:\n        i+=1\n    p+=1\nans+=f(i)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\ns = input()\np=[]\nq=[]\nx=input().split()\nk=\"\"\nt=0\nfor i in s:\n    if i in x:\n        k+=i\n        t+=1\n    else:\n        p.append(k)\n        q.append(t)\n        k=\"\"\n        t=0\np.append(k)\nq.append(t)\nres = 0\nfor i in q:\n    res+=(i*(i+1))//2\nprint(res)\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "n, k = tuple(map(int, input().split()))\ns = input() + '!'\nlets = set(input().split())\n\nans = 0\ncnt = 0\nfor i in s:\n    if i in lets:\n        cnt += 1\n    else:\n        ans += cnt * (cnt + 1) // 2\n        cnt = 0\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "n, k = list(map(int, input().strip().split()))\nstring = input().strip()\nforbidden = input().strip().split()\n\nforbidden = set(forbidden)\n\nstring = list(string)\nfor i in range(len(string)):\n    if string[i] not in forbidden:\n        string[i] = None\n\ncnt = 0\ni = 0\nwhile i < len(string):\n    if string[i] == None:\n        i += 1\n    else:\n        j = i\n        while j < len(string) and string[j] != None:\n            j += 1\n        diff = j - i\n        cnt += (diff*(diff+1))//2\n        i = j\n\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14148.0, "status": "done"}, {"code": "n = input()\ns = input()\ns += \"-\"\navailable = input().split()\n\nlength = 0\nans = 0;\nfor i in s:\n    if (i in available):\n        length += 1\n    else:\n        ans += length*(length+1) // 2\n        length = 0\n        \nprint(ans)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n# coding: utf-8\n# Last Modified: 12/Dec/19 07:21:47 PM\n\n\nimport sys\n\n\ndef main():\n    n, k = get_ints()\n    s = input()\n    d = set(input().split())\n    ans = 0\n    curr = 0\n    for i in range(len(s)):\n        if s[i] in d:\n            curr += 1\n        else:\n            ans += (curr * (curr + 1)) // 2\n            curr = 0\n    ans += (curr * (curr + 1)) // 2\n    print(ans)\n\n\nget_array = lambda: list(map(int, sys.stdin.readline().split()))\n\n\nget_ints = lambda: list(map(int, sys.stdin.readline().split()))\n\n\ninput = lambda: sys.stdin.readline().strip()\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.22, "memory": 14260.0, "status": "done"}, {"code": "import sys, math\n\ndef input():\n    return sys.stdin.readline()[:-1]\n\ndef main():\n    n, k = list(map(int,input().split()))\n    s = input()\n    c = set(input().split())\n    prev = 0\n    ans = 0\n    for k in range(n):\n        if s[k] not in c:\n            l = k-prev\n            ans += (l*(l+1))//2\n            prev = k+1\n    l = k-prev+1\n    ans += (l*(l+1))//2\n    print(ans)\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "a, b = map(int, input().split())\ns = input()\nl = list(input().split(\" \"))\nmass = [0 for i in range(300)]\nfor i in range(b):\n    mass[ord(l[i])] = 1\nresm = []\np = 0\nfor i in range(a):\n    if mass[ord(s[i])] == 1:\n        p += 1\n    else:\n        resm += [p]\n        p = 0\nresm += [p]\nres = 0\nfor i in range(len(resm)):\n    res += (resm[i] * (resm[i] + 1)) // 2\nprint(res)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "n,k=list(map(int,input().strip().split()))\nx=list(input())\na=input().strip().split()\nxx=0\nop=0\nfor i in x:\n    if(i in a):\n        xx+=1\n    else:\n        op=op+(xx*(xx+1)//2)\n        xx=0\nop=op+(xx*(xx+1)//2)  \n# xx=xx-len(x)+xx-1\n# print(xx*(xx+1)//2,xx,op)\nprint(op)", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "n, k = map(int, input().split())\ns = input()\nchars = set(map(str, input().split()))\n\ntotal = 0\n\ncur = 0\nfor i in s:\n    if i in chars:\n        cur += 1\n    else:\n        if cur != \"\":\n            total += cur*(cur+1) // 2\n        cur = 0\n\nif cur != 0:\n    total += cur*(cur+1) // 2\n\n\nprint(total)", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}]