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