st1 = input().lower() # 将字符串中字母全部转为小写 st2 = input().lower() # 将寻找的字符中的字母转为小写,与输入一致 num = 0 for str in st1: if st2 == str: num += 1 print(num)