#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans1 = 0;
  int count_black = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      count_black++;
    } else {
      ans1 += count_black;
      count_black = 0;
    }
  }
  int ans2 = 0;
  int count_white = 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;
}
