use std::io::Read; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let s: Vec<_> = s.lines().collect(); let n = s[0].split(s[1]).count() as i32 - 1; println!("{}", if s[1].len() == 1 && n > 1 { -1 } else { n }) }