#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int l = S.find('#');
  l = max(0, l);
  int r = N;
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] != '#') {
      r = i + 1;
      break;
    }
  }
  int countA = 0;
  for (int i = l; i < r; i++) {
    if (S[i] == '#') countA++;
  }
  int countB = 0;
  for (int i = l; i < r; i++) {
    if (S[i] == '.') countB++;
  }
  cout << min(countA, countB) << endl;
}
