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