#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool first_black_index = 9999999;
  int b_cnt = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      if (i < first_black_index) {
        first_black_index = i;
      }
      b_cnt++;
    }
  }
  int rest = n - first_black_index;
  int change;
  if (b_cnt == 0) {
    change = 0;
  } else if (rest - b_cnt <= rest / 2) {
    change = rest - b_cnt;
  } else {
    change = rest;
  }
  cout << change << endl;
  return 0;
}
