while True:
    try:
        a = input()
        aa = a.lower()
        b = input().lower()
        n = aa.count(b)
        print(n)

    except:
        break