#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans1 = 0;
  bool before_is_white = false;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '.') {
      before_is_white = true;
    } else {
      if (before_is_white) {
        ans1++;
      }
    }
  }
  int ans2 = 0;
  bool before_is_black = false;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      before_is_black = true;
    } else {
      if (before_is_black) {
        ans2++;
      }
    }
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
