use std::iter::*;
use std::cmp::*;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn print<T: std::fmt::Display>(x: T) -> () {
    println!("{}", x);
}


fn main() {
    let n: usize = read();
    let s: String = read();
    let cs: Vec<char> = s.chars().collect();
    let mut ans = 0;

    if n != 1 {
        let mut cs = cs.clone();
        for i in 0..(n - 2) {
            if cs[i] == '#' && cs[i + 1] == '.' {
                if cs[i + 2] == '.' {
                    cs[i] = '.';
                    ans += 1;
                } else {
                    cs[i + 1] = '#';
                    ans += 1;
                }
            }
        }

        if cs[n - 2] == '#' && cs[n  - 1] == '.' {
            ans += 1;
        }
    } 
    print(ans);
}
