#include <bits/stdc++.h>
using namespace std;
int main() {
  int nlong, startcount, bcount, wcount;
  bcount = 0;
  wcount = 0;
  cin >> nlong;
  char strs[nlong + 10];
  cin >> strs;
  for (int i = 0; i < nlong; i++) {
    if (strs[i] == '#') {
      startcount = i;
      break;
    }
  }
  for (int k = startcount; k < nlong; k++) {
    if (strs[k] == '#') {
      bcount++;
    } else if (strs[k] == '.') {
      wcount++;
    }
  }
  cout << min(bcount, wcount) << endl;
}
