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