#include <bits/stdc++.h>
using namespace std;
int N;
string S;
int solve() {
  int w, b = 0;
  int pos = S.find("#.");
  for (int i = pos + 1; i < S.size(); i++) {
    if (S[i] == '.')
      w++;
    else
      b++;
  }
  return min(w, b);
}
int main() {
  cin >> N >> S;
  cout << solve() << endl;
  return 0;
}
