inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
N = inp.shift() * 1
s = inp.shift()
wc = 0
bc = 0
b = [0]
w = []
w[N+1] = 0
for (i=0;i<N;i++){
    if (s[i] == '#') {
        bc++
    }
    if (s[N-i-1] == '.') {
        wc++
    }
    b[i+1] = bc 
    w[N-i] = wc 
}
min = Infinity
for (i=0; i<=N; i++) {
    m = b[i] + w[i+1]
    if (m < min) {
        min = m
    }
}
console.log(min)