#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  char S[N];
  cin >> S;
  int white, black;
  white = black = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      white++;
    } else {
      black++;
    }
  }
  if (S[N - 1] == '#') {
    cout << max(0, min(white, black) - 1) << endl;
  } else {
    cout << min(white, black) << endl;
  }
}
