#include <bits/stdc++.h>
using namespace std;
int main() {
  long N;
  cin >> N;
  string s;
  cin >> s;
  long kuro = 0, siro = 0;
  for (long i = 0; i < N; i++) {
    if (s.at(i) == '#') {
      kuro++;
    }
    if (s.at(i) == '.') {
      siro++;
    }
  }
  long kurohiku = 0;
  long sirohiku = 0;
  for (long i = N - 1; i >= 0; i--) {
    if (s.at(i) == '#') {
      kurohiku++;
    } else {
      break;
    }
  }
  for (long i = 0; i < N; i++) {
    if (s.at(i) == '.') {
      sirohiku++;
    } else {
      break;
    }
  }
  kuro -= kurohiku;
  siro -= sirohiku;
  cout << min(kuro, siro) << endl;
  return 0;
}
