def main(): import sys input = sys.stdin.readline S = input().rstrip('\n') T = input().rstrip('\n') nt = len(T) N = len(S) if len(T) == 1: if S.count(T) > 0: print(-1) else: print(0) i = 0 ans = 0 while True: if S[i:i+nt] == T: ans += 1 i = i+1 else: i += 1 if i >= N: break print(ans) if __name__ == '__main__': main()