#![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 max_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 max_dist < d { max_dist = d; ans = match (i == 0, i == g.len()-1) { (true, _) => 0, (_, true) => N-1, _ => p + d - 1, }; } } p += w; } println!("{}", ans+1); }