function main(input) {
  const formatted_input = input.split('\n');
 
  const N = parseInt(formatted_input[0], 10);
  const S = formatted_input[1];

  var count = 0;
  var blacked = false;

  for(var i=0; i<N ;i++ ){
    var current = S[i];
    if( blacked && current == '.' ){
      count++;
    }
    if( !blacked && current == '#' ){
      blacked=true;      
    }
  }
  console.log(count);
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

