#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans_w = 0;
  bool is_w = false;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s.at(i) == '.') {
      is_w = true;
    } else {
      if (is_w) {
        ans_w++;
      }
    }
  }
  int ans_b = 0;
  bool is_b = false;
  for (int i = 0; i < s.size(); i++) {
    if (s.at(i) == '#') {
      is_b = true;
    } else {
      if (is_b) {
        ans_b++;
      }
    }
  }
  cout << min(ans_b, ans_w) << endl;
  return 0;
}
