import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); char[] s = sc.next().toCharArray(); char[] t = sc.next().toCharArray(); sc.close(); if (t.length == 1) { for (int i = 0; i < s.length; i++) { if (s[i] == t[0]) { System.out.println(-1); return; } } System.out.println(0); return; } int ans = 0; int j = 0; for (int i = 0; i < s.length; i++) { if (s[i] == t[j]) { if (j == t.length - 1) { ans++; j = 0; if (s[i] == t[j]) { j++; } } else { j++; } } else { j = 0; } } System.out.println(ans); } }