use std::io::Read;
use std::cmp::min;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

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

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();
    let s: Vec<char> = iterator.next().unwrap().chars().collect();

    let mut s1 = s.clone();
    let mut c1: usize = 0;
    for i in 0..(n - 1) {
        if s1[i] == '#' && s1[i + 1] == '.' {
            s1[i + 1] = '#';
            c1 += 1;
        }
    }

    let mut s2 = s.clone();
    let mut c2: usize = 0;
    for i in (1..n).rev() {
        if s2[i - 1] == '#' && s2[i] == '.' {
            s2[i - 1] = '.';
            c2 += 1;
        }
    }

    return min(c1, c2).to_string();
}
