#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  int fb = -1;
  int cw = 0, cb = 0;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      fb = i;
      break;
    }
  }
  if (fb < 0) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = fb; i < n; i++) {
    if (s[i] == '#')
      cb++;
    else
      cw++;
  }
  cout << min(cb, cw) << endl;
  return 0;
}
