#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int p1 = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] != '#') {
      p1++;
    }
  }
  int p3 = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] != '.') {
      p3++;
    }
  }
  vector<int> whiteNums;
  int whiteCount = 0;
  int p2 = 200000;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == '.') {
      whiteCount++;
    }
    whiteNums.push_back(whiteCount);
  }
  for (int i = 0; i < s.size(); ++i) {
    int numBlack = i + 1 - whiteNums[i];
    int numWhite = whiteNums[s.size() - 1] - whiteNums[i];
    cout << numBlack << ',' << numWhite << endl;
    p2 = min(p2, numBlack + numWhite);
  }
  int answer = 0;
  answer = min(p1, p2);
  answer = min(answer, p3);
  cout << answer << endl;
  return 0;
}
