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