use proconio::input; use proconio::marker::Chars; fn main () { input! { _: usize, s: Chars, } let s = s.iter().collect::(); let s = s.replace("CPCTCPC", "CPCTF"); //println!("{}", s); let ans = s.matches("CPCTF").count(); println!("{}", ans); }