#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, f1 = 0, f2 = 0, cw = 0, cb = 0;
  string s;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      f1 = 1;
      if (f2 == 0) {
        cb++;
      }
    } else {
      f2 = 1;
      if (f1 == 1) {
        cw++;
      }
    }
  }
  cout << min(cw, cb);
  return 0;
}
