#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int firstblack = 0, firstwhite = 0, blackcount = 0, whitecount = 0;
  for (int i = 0; i < N; i++) {
    if (firstblack == 0 && S[i] == '#') {
      firstblack = 1;
    }
    if (firstblack == 1 && S[i] == '.') whitecount++;
  }
  for (int i = N - 1; i >= 0; i--) {
    if (firstwhite == 0 && S[i] == '.') {
      firstwhite = 1;
    }
    if (firstwhite == 1 && S[i] == '#') {
      blackcount++;
    }
  }
  cout << min(blackcount, whitecount) << endl;
  return 0;
}
