while True:
    try:
        ls = input()
        ls1 = ls.upper()
        a = input()
        b = a.upper()
        n = ls1.count(b) 
        print(n)
    except:
        break