def checker(string, error, ans=0, start=0): for i in range(start, len(string) - len(error) + 1): if string[i: i + len(error)] == error: return checker(string, error, ans + 1, i + len(error) - 1) return ans string = input() error = input() if 1 == len(error): for i in range(len(string)): if i == error: print('-1') exit() print('0') exit() if len(error) > len(string): print('0') exit() print(checker(string, error))