s = input().lower()#输入字符串,并把字母全部转变为小写
a = input().lower()#输入要匹配的字符,并转变为小写
print(s.count(a))#输出字符串中字符的个数