#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, right_w = 0, right_b = 0;
  string s;
  cin >> n;
  cin >> s;
  if (n < 2) {
    cout << "0" << endl;
    return 0;
  }
  bool first_b = false;
  for (long i = 0; i < n; i++) {
    if (s[i] == '#') {
      right_b++;
      first_b = true;
    }
    if (s[i] == '.') {
      if (first_b == true) right_w++;
    }
  }
  cout << min(right_b, right_w) << endl;
  return 0;
}
