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