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