#![allow(non_snake_case, unused_imports)] use std::cmp::{min, max, Reverse}; use std::collections::{BinaryHeap, Bound, HashMap, HashSet, VecDeque}; use std::hash::Hash; use std::ops::RangeBounds; use ac_library::{Additive, Min, Segtree}; use proconio::{input, marker::Usize1, marker::Chars}; use itertools::Itertools; #[allow(unused_macros)] macro_rules! d { ( $( $x:expr ),* $(,)? ) => { eprintln!( concat!( $( stringify!($x), "={:?} " ),* ), $( $x ),* ); }; } #[allow(dead_code)] fn yn(b: bool) -> &'static str { if b { "Yes" } else { "No" } } fn main() { input! { N: usize, S: Chars, } let g = S .chunk_by(|a, b| a == b) .collect_vec(); let mut dist = 0; let mut p = 0; let mut ans = 0; for (i, x) in g.iter().enumerate() { let w = x.len(); if x[0] == '.' { let d = if i == 0 || i == g.len()-1 { w } else { (w+1) / 2 }; if dist < d { dist = d; if i == 0 { ans = 0 } else if i == g.len()-1 { ans = N-1 } else { ans = p + d - 1; } } } p += x.len(); } println!("{}", ans+1); }