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