use proconio::{input, marker::Chars};

fn main() {
    input! {
        n: usize,
        s: Chars,
    }

    let mut count_white = 0;
    for &c in s.iter() {
        if c == '.' {
            count_white += 1;
        }
    }

    let mut count_black = 0;
    let mut ans = n;

    for c in s {
        match c {
            '.' => count_white -= 1,
            '#' => count_black += 1,
            _ => {}
        }
        ans = std::cmp::min(ans, count_black + count_white);
    }

    println!("{}", ans);
}
