#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int w_sum = 0;
  int b_sum = 0;
  int start = -1;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      start = i;
      break;
    }
  }
  if (start == -1) {
    cout << 0 << endl;
    return 0;
  }
  int end = -1;
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '.') {
      end = i;
      break;
    }
  }
  if (end < start) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = start; i <= end; i++) {
    if (S[i] == '#') {
      b_sum++;
    } else {
      w_sum++;
    }
  }
  cout << min(b_sum, w_sum) << endl;
  return 0;
}
