#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> c(1, 0);
  int fir = 0, sec = 0;
  int ind = 0;
  while (ind < n) {
    if (s[ind] == '#') {
      fir += 1;
    } else {
      sec += 1;
    }
    ind += 1;
  }
  cout << min(fir, sec) << endl;
  return 0;
}
