#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string S;
  cin >> N >> S;
  long long first = LLONG_MAX;
  for (long long i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      first = i;
      break;
    }
  }
  long long black = 0, white = 0;
  for (long long i = first; i < N; i++) {
    if (S.at(i) == '.') {
      black++;
    } else {
      white++;
    }
  }
  if (first > N) {
    cout << 0 << endl;
  } else {
    cout << min(white, black) << endl;
  }
}
