#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N;
  string S;
  cin >> N >> S;
  int index = -1;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      index = i;
      break;
    }
  }
  int count = 0;
  if (index >= 0) {
    for (int k = index; k < N; k++) {
      if (S[k] == '.') count++;
    }
  }
  int white = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '.') white++;
  }
  cout << min(count, min(white, (int)(N)-white)) << endl;
}
