#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  cin >> n;
  cin >> s;
  bool fl = false;
  int w = 0;
  int b = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      b++;
      fl = true;
    }
    if (fl == true && s[i] == '.') {
      w++;
    }
  }
  cout << min(w, b) << endl;
  return 0;
}
