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 mut s = s.trim().chars().collect::>(); s.reverse(); let mut maxval = 0usize; let mut delay = 0usize; for i in 0..n { if s[i] == '.' { if delay > 0 { delay -= 1; } continue; } maxval = maxval.max(i+1+delay); delay += 1; } println!("{}", maxval); }