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