#include <bits/stdc++.h>
using namespace std;
long long int n, q;
int main() {
  long long int n, i, bkCnt = 0, wtCnt = 0;
  string s;
  bool bFlg = false;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      break;
    }
  }
  for (; i < n; i++) {
    if (s[i] == '#') {
      ++bkCnt;
    } else {
      ++wtCnt;
    }
  }
  if (wtCnt < bkCnt) {
    cout << wtCnt << endl;
  } else {
    cout << bkCnt << endl;
  }
  return 0;
}
