#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t N, white = 0, black = 0;
  cin >> N;
  char c;
  bool cntWhite = false;
  for (int i = 0; i < N; i++) {
    cin >> c;
    if (c == '#') {
      cntWhite = true;
      black++;
    } else {
      if (cntWhite) white++;
    }
  }
  cout << min(black, white) << endl;
}
