use std::io::stdin;
use std::time::SystemTime;

fn main() {
    let n: u64 = read().parse().unwrap();
    let mut s: Vec<char> = read().chars().collect();
    let mut s2 = s.clone();
    let mut count = 0;
    let mut count2 = 0;
    for i in 0..s.len()-1 {
        if s[i] == '#' && s[i + 1] == '.' {
            s[i + 1] = '#';
            count = count + 1;
        }
    }
    for i in 1..s2.len() {
        if s2[i] == '.' && s2[i - 1] == '#' {
            s2[i - 1] = '.';
            count2 = count2 + 1;
        }
    }
    if count < count2 {
        println!("{}", count);
    } else {
        println!("{}", count2);
    }
}

fn read() -> String {
    let mut s = String::new();
    stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}