s = input() t = input() if set(list(t)) == set(["."]) and t in s: print(-1) else: ans = 0 tmp = "" for c in s: if len(tmp) == len(t): tmp = tmp[1:] tmp += c if tmp == t: ans += 1 tmp = "" print(ans)