#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, count = 0, count2 = 0;
  string S;
  cin >> N;
  cin >> S;
  bool blackAppeared = false;
  bool whiteAppeared = false;
  for (int i = 0; i < N; i++) {
    if (!blackAppeared) {
      if (S[i] == '#') {
        blackAppeared = true;
      }
    } else {
      if (S[i] == '.') {
        count++;
      }
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    if (!whiteAppeared) {
      if (S[i] == '.') {
        whiteAppeared = true;
      }
    } else {
      if (S[i] == '#') {
        count2++;
      }
    }
  }
  cout << min(count, count2) << endl;
  return 0;
}
