#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int left = 0;
  int right = N - 1;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      left = i;
      break;
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '.') {
      right = i;
      break;
    }
  }
  int b_count = 0;
  int w_count = 0;
  for (int i = left; i <= right; i++) {
    if (S[i] == '#') {
      b_count++;
    } else {
      w_count++;
    }
  }
  if (b_count < w_count) {
    cout << b_count << endl;
  } else {
    cout << w_count << endl;
  }
  return 0;
}
