# import sys
while True:
    try:
        s = input().lower()
        c = input().lower()
        print(s.count(c))
    except:
#         print(sys.exc_info())
        break