a = input() b = input() num =0 for i in range(len(a)): if b.lower() == a[i].lower(): num = num + 1 print(num)