"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;

  for (var i = 0; i <= N; i++) {
    var sum = 0;

    for (var j = 0; j < i; j++) {
      if (s[j] != ".") {
        sum++;
      }
    }

    for (var _j = i; _j < N; _j++) {
      if (s[_j] != "#") {
        sum++;
      }
    }

    ans = Math.min(sum, ans);
  }

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