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 result = 200001;

  for(var i=0; i<=N ;i++ ){
    count = 0;
    for(var j=0 ; j<N ; j++){
      var current = S[j];
      if(j<=i && current=='#'){
        count++;
      }

      if(j>i && current=='.'){
        count++;
      }

    }
    result = Math.min(result, count);
    //console.log('---');
    //console.log(`${result},${i}`);
  }
  console.log(result);
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

