use std::io::stdin;
use std::time::SystemTime;

fn main() {
    let n: u64 = read().parse().unwrap();
    let mut s: Vec<char> = read().chars().collect();
    let mut count = 0;
    let mut count2 = 0;
    if !s.contains(&'#') || !s.contains(&'.') {
        println!("0");
    } else {
        let mut start = 0;
        let mut end = s.len();
        loop {
            if s[end - 1] == '#' {
                end = end - 1;
            } else {
                break;
            }
        }
        loop {
            if s[start] == '.' {
                start = start + 1;
            } else {
                break;
            }
        }
        for i in start..end - 1 {
            if s[i] == '#' && s[i + 1] == '.' {
                count = count + 1;
            } else {
                count2 = count2 + 1;
            }
        }
        if count < count2 || count2 == 0 {
            println!("{}", count);
        } else {
            println!("{}", count2);
        }
    }
}

fn read() -> String {
    let mut s = String::new();
    stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}
