def main(): from sys import stdin readline=stdin.readline s = input() t = input() if len(t) == 1: print(-1) else: print(s.count(t)) main()