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