fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let s = s.trim().chars().collect::>(); let mut cnts = vec![vec![0usize; 3]; 3]; for i in 0..s.len() { let c = s[i]; if c == 'c' { cnts[0][i%3] += 1; } else if c == 'o' { cnts[1][i%3] += 1; } else if c == 'n' { cnts[2][i%3] += 1; } } println!("{}", (0..3).map(|i| cnts[0][i].min(cnts[1][(i+1)%3]).min(cnts[2][(i+2)%3])).sum::()); }