use itertools::Itertools; use proconio::{input, marker::Chars}; fn main() { input! { n: usize, s: Chars, } let happy = "HAPPY".chars().collect_vec(); let mut ans = 0; for i in 0..n - 5 { if &s[i..][..5] == &happy { ans += 1; } } for i in 0..5 { if s[n - 5 + i] != happy[i] { ans += 1; } } println!("{ans}"); }