#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 = N - 1; i >= 0; i--) {
    if (S[i] == '#' && white == 0) {
      continue;
    }
    if (S[i] == '.') {
      white++;
    } else {
      black++;
    }
  }
  cout << min(white, black) << endl;
}
