use std::iter::Iterator;
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 get_num(vec: &Vec<char>, range: std::ops::Range<usize>, color: char) -> usize {
    vec[range].into_iter().filter(|&x| *x == color).count()
}

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

    let num = (1..n)
        .into_iter()
        .filter(|&x| s[x - 1] != s[x])
        .map(|x| (0..x, x..n))
        .map(|(l, r)| get_num(&s, l, '#') + get_num(&s, r, '.'))
        .min()
        .unwrap();

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