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