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