const fs = require('fs')
const stdin = fs.readFileSync('/dev/stdin', 'utf8')

const s = stdin.split('\n')[1]

const S = s.split('')

let leftBlack = 0
let rightWhite = S.reduce((p, c) => {
  return p += c === '.' ? 1 : 0
}, 0)

let min = Number.MAX_SAFE_INTEGER
S.forEach(v => {
  leftBlack += v === '#' ? 1 : 0 
  rightWhite -= v === '.' ? 1 : 0
  
  const sum = leftBlack + rightWhite

  min = sum < min ? sum : min
})

console.log(min)