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].

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;


public class Solve {
    static final int MOD = 1000000007;

    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out, true);

        int t =1;
        while (t-- > 0)
            solve(in, out);

    }

    private static void solve(BufferedReader in, PrintWriter out) throws Exception {
       String[] nk=in.readLine().trim().split("\\s+");
       int n=Integer.parseInt(nk[0]);
       int k=Integer.parseInt(nk[1]);

       String s=in.readLine().trim();
       String kString=in.readLine();

       long c=0,ans=0;;
       for(int i=0;i<n;i++){
             if(kString.contains(""+(s.charAt(i))))
             c++;
             else {
                 ans+=c*(c+1)/2;
                 c=0;
             }
       }
       ans+=c*(c+1)/2;
       out.println(ans);
      }
      private static int upperBound(int[] arr,int key){
          int low=0;
          int high=arr.length-1;
         
          while(low<high){
              int mid=low+(high-low)/2;
              if(arr[mid]<=key){
                  low=mid+1;               
              }
             else high=mid;
          }
          return low;
      }
      

      private static long power(long n,long p,long m){
        
        long result=1;

        while(p>0){
            if(p%2==1) result=(result*n)%m;
            n=(n*n)%m;
            p>>=1;
        }
        return result;
    }

   private int gcd(int a, int b) {
        if(b==0)
            return a;
        else
            return gcd(b, a % b);
    }


    private static void sieve(int n){
         boolean[] prime=new boolean[n];
         for(int i=0;i<n;i++)
             prime[i]=true;
         for(int i=2;i*i<n;i++){
            if(prime[i]){
                for(int j=i*i;j<n;j+=i)
                 prime[j]=false;
            }
        }
         for ( int i = 2; i < prime.length; i++) {
             if(prime[i])
              System.out.print(i+" ");
         }  
         
    
    }

    private static void segmentedSieve(int low,int high){

        int sqrt=(int) Math.sqrt(high);
        int[] prime=new int[sqrt+1];
        boolean[] arr=new boolean[sqrt+1];

        for(int i=0;i<=sqrt;i++)
            arr[i]=true;

        int k=0;
        for(int i=2;i<=sqrt;i++){           //generate all prime numbers till square root of high
            if(arr[i]){
                prime[k]=i;
                
                k++;
                for (int j = i*i; j <= sqrt; j+=i) 
                    arr[j]=false;
        
                
             }
        }
        // System.out.println(Arrays.toString(prime));

        int diff=high-low+1;          // arr size of required length 
        arr=new boolean[diff];
        for(int i=0;i<diff;i++)
             arr[i]=true;
        
        for(int i=0;i<k;i++){               // mark false to multiple of prime numbers in the range of low to high
            int div=(low/prime[i])*prime[i];        // It gives multiple of prime[i] nearest to low 
            if(div<low || div==prime[i])
               div+=prime[i];
            for(int j=div;j<=high;j+=prime[i]){
                 if(j!=prime[i])
               arr[j-low]=false;
            }
        }
        for(int i=0;i<diff;i++){                //print prime numbers in the given segment
            if(arr[i] && (i+low)!=1){
                System.out.print(i+low+" ");
            }
        }
        System.out.println();

    }

    class Pair implements Comparable<Pair>{
        int a;
        int b;
        public Pair(int a,int b){
            this.a=a;
            this.b=b;
        }
    
        @Override
        public int compareTo(Pair o) {
          if(this.a>o.a) return this.a-o.a;
          else if(this.a<o.a)
              return this.b-o.b;
          
          else  return 0;
         
        }
    }
}
