fn main() { println!("{}", solve()); } fn solve() -> usize { let n = { let mut line = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.trim().parse::().unwrap() }; let cc: Vec = { let mut line = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.trim().chars().collect() }; for i in (0..n).rev() { if ['A', 'G', 'C', 'T'].contains(&cc[i]) { return i + 1; } } 0 }