import java.util.*;
import java.io.*;
public class strings {
     public static void main (String[] args) throws Exception {
        Scanner in = new Scanner(new File("strings.in"));
        PrintWriter out = new PrintWriter(new File("strings.out"));
        String s1 = in.next();
        String s2 = in.next();
        int len1 = s1.length(), cnt = 0;
        char[] c1 = new char[len1];
        for(int i = 0; i < len1; ++i){
            c1[i] = s1.charAt(i);
            if(!s2.contains(""+c1[i]))
               cnt++;
        }
        out.println(cnt);
        in.close();
        out.close();
     }
}
