import java.util.Scanner;

/**
 * HJ2 计算某字符出现次数
 */
public class HJ002 {
    
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        String str1= s.nextLine();
        String str2 = s.nextLine();
        String split = str1.toUpperCase().replaceAll(str2.toUpperCase(),"");
        System.out.println(str1.length() - split.length());
    }
}