#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  int count;
  int kuro;
  int siro;
  cin >> N;
  cin >> S;
  count = 0;
  kuro = 0;
  siro = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S.at(i) == '#') {
      for (int i = 0; i < N - i; i++) {
        if (S.at(i) == '#') {
          kuro = kuro + 1;
        } else {
          siro = siro + 1;
        }
      }
      if (kuro >= siro) {
        S.at(i + 1) = '#';
        count = count + 1;
      }
    }
  }
  if (kuro < siro) {
    cout << siro << endl;
  } else {
    cout << count << endl;
  }
}
