#[allow(unused_imports)]
use itertools::Itertools;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;

fn main() {
    input! {
        n: usize,
        mut s: Chars,
    }
    let mut a = vec![0; n + 1];
    for i in 0..n {
        if s[i] == '#' {
            a[i+1] += 1;
        }
        a[i+1] += a[i];
    }


    println!("{}", (1..=n).map(|i|a[i] + n-i - (a[n]-a[i])).min().unwrap());
}
