"use strict";

function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0], 10);
  var S = input[1];
  var s = [...S];
  var firstB = s.indexOf("#");
  var toB = 0;

  if (firstB >= 0) {
    for (var i = firstB; i < N; i++) {
      if (s[i] != "#") {
        toB++;
      }
    }
  }

  var lastW = s.lastIndexOf(".");
  var toW = 0;

  if (lastW >= 0) {
    for (var _i = 0; _i < lastW; _i++) {
      if (s[_i] != ".") {
        toW++;
      }
    }
  }

  var blackNum = 0;

  for (var _i2 = 0; _i2 < N; _i2++) {
    if (s[_i2] == "#") {
      blackNum++;
    }
  }

  console.log(Math.min(blackNum, toW, toB));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));