s = str(input()) t = str(input()) if len(t) == 1: print(-1) exit() import re m = re.findall(t, s) print(len(m))