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