#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int black = 0, white = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') {
      ++white;
      continue;
    }
    string tmp = s.substr(i);
    for (int k = 0; k < tmp.size(); ++k) {
      if (tmp[k] == '#') ++black;
    }
    cout << min(n - max(black, white), min(black, (int)tmp.size() - black))
         << endl;
    break;
  }
  if (n - max(black, white) == 0) cout << 0 << endl;
}
