"use strict";

function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0], 10);
  var S = input[1];
  var s = [...S];
  var ans = N;
  var whiteSum = 0;
  var whiteCount = new Array(N + 1).fill(0);
  whiteCount[0] = 0;

  for (var i = 0; i < N; i++) {
    if (s[i] == ".") {
      whiteSum++;
    }

    whiteCount[i + 1] = whiteSum;
  } //console.log(whiteCount);


  for (var _i = 0; _i <= N; _i++) {
    //console.log(i, whiteCount[i], whiteCount[N], whiteCount[i]);
    var sum = _i - whiteCount[_i] + whiteCount[N] - whiteCount[_i];
    ans = Math.min(sum, ans);
  }

  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));