#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};
fn main() {
    input! {//
        n:usize,
        s:Chars,
    }
    let mut rblack = s.iter().filter(|&&x| x == '#').count() as i64;
    let mut rwhite = s.iter().filter(|&&x| x == '.').count() as i64;
    let mut lwhite = 0i64;
    let mut lblack = 0i64;
    let mut ans = INF;
    for (i, &c) in s.iter().enumerate() {
        if c == '#' {
            lblack += 1;
            rblack -= 1;
        } else {
            lwhite += 1;
            rwhite -= 1;
        }
        ans = min(ans, lblack + rwhite);
    }
    println!("{}", ans);
}

const INF: i64 = 1 << 60;
