target = input() patten = input() s = target.count(patten) print(s) try: m = target.index(patten) except ValueError: print('-1') else: print(m)