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