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