fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn get<T: std::str::FromStr + Clone>() -> T {
    let line = read_vec::<T>();
    line[0].clone()
}

fn to_vec(string: String) -> Vec<char > {
    let mut vec = Vec::<char>::new();
    for c in string.chars() {
        vec.push(c);
    }
    vec
}

fn main() {
    let n = get::<usize>();
    let _s = get::<String>();
    let s = to_vec(_s);

    let mut black = 0;
    let mut white = 0;
    let mut count_up = false;

    for x in 0..n {
        let c = s[x];
        if c == '#' {
            if x < n - 1 {
                count_up = true;
                black += 1;
            }
        } else {
            if count_up {
                white += 1;
            }
        }
    }

    println!("{}", std::cmp::min(black, white));
}
