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

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

const N = Number(n)

const S = s.split('')

let count = 0
for(let i = 0; i < N; i++){
  if(i+1 >= N)break
  if(S[i] === '#' && S[i+1] === '.'){
    S[i+1] = '#'
    count++
  }
}
console.log(count)