const fs = require('fs')
const stdin = fs.readFileSync('/dev/stdin', 'utf8')
 
const [n, s] = stdin.split('\n')
 
const S = s.split('')
 
let leftBlack = 0
let rightWhite = S.reduce((p, c) => {
  return p += c === '.' ? 1 : 0
}, 0)
 
const sum = S.map((v, i) => {
  leftBlack += v === '#' ? 1 : 0 
  rightWhite -= v === '.' ? 1 : 0
  return leftBlack + rightWhite
})
 
const min = Math.min(...sum)
 
console.log(min)