fn main() { let mut xx = String::new(); std::io::Read::read_to_string(&mut std::io::stdin(), &mut xx).ok(); let xx: Vec> = xx.split_whitespace().map(|s| s.chars().collect()).collect(); let mut answer = 0; for s in &xx[2..] { answer += xx[0].windows(s.len()).filter(|&x| x == s).count(); } println!("{}", answer); }