inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
N = inp.shift() * 1
s = inp.shift()
l = 0
r = s.length
while(s[l] == '.') {
    l++
}
while(s[r-1] == '#') {
    r--
}
c=0
for (i=l; i<r; i++) {
    if (s[i] == '#') {
        c++
    }
}
console.log(Math.min(c, r - l - c))