#!/usr/bin/python
#-*- coding:utf-8 -*-
#计算b字符在a字符串里面出现的次数
while True:
try:
src_str = raw_input()
find_str = raw_input()
if len(src_str)>1000 or len(src_str)<1 or len(find_str) !=1:
raise Exception
print src_str.count(find_str)
break
except Exception:
print "字符串大于1个小于1000个字符,第二次输入应该是单字符"