import java.io.BufferedReader import java.io.InputStream import java.io.InputStreamReader import java.lang.StringBuilder import java.util.* fun main(args: Array) { val sc = FastScanner(System.`in`) val s = sc.nextLine().toMutableList() val t = sc.nextLine() val n = s.count() val m = t.length var count = 0 for (i in 0 until n - m + 1) { var same = true for (j in 0 until m) { if (s[i + j] != t[j]) { same = false break } } if (same) { if (m == 1) { println(-1) return } s[i + m - 2] = '.' count++ } } println(count) } class FastScanner(s: InputStream) { private var st = StringTokenizer("") private val br = BufferedReader(InputStreamReader(s)) fun next(): String { while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine()) return st.nextToken() } fun nextInt() = next().toInt() fun nextLong() = next().toLong() fun nextLine() = br.readLine() fun nextDouble() = next().toDouble() fun ready() = br.ready() }