#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cntBlack = 0, cntWhite = 0;
  bool isWhite = true;
  for (auto& e : s) {
    if (e == '#') {
      isWhite = false;
    }
    if (!isWhite && e == '.') {
      cntBlack++;
    }
    if (e == '#') {
      cntWhite++;
    }
  }
  cout << (isWhite ? 0 : min(cntBlack, cntWhite)) << endl;
}
