#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int whiteNum = 0;
  for (auto c : s) {
    whiteNum += (c == '.' ? 1 : 0);
  }
  if (whiteNum == n || whiteNum == 0) {
    cout << 0 << endl;
    return 0;
  }
  int diff = 0, diffmin = 0;
  bool firstWhite = true;
  for (auto c : s) {
    if (c == '#') {
      diffmin = min(diffmin, diff);
    }
    diff += (c == '#' ? 1 : -1);
  }
  cout << whiteNum + diffmin << endl;
  return 0;
}
