#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  int black = 0;
  int white = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      black++;
    } else {
      white++;
    }
  }
  for (int i = 0; i < n - 1; i++) {
    if (s[n - 1 - i] == '#') {
    } else {
      if (s[n - 2 - i] == '#') {
        ans++;
      }
    }
  }
  if (black * white != 0) {
    cout << min(ans, min(black, white)) << endl;
  } else {
    cout << ans << endl;
  }
  return 0;
}
