#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int zn = 0, fn = 0;
  bool fl = true;
  for (int i = 0; i < n; i++) {
    if (fl && s[i] == '#') {
      fl = false;
      fn += 1;
    } else if (!fl && s[i] == '.') {
      zn += 1;
    } else if (!fl && s[i] == '#') {
      fn += 1;
    }
  }
  cout << min(zn, fn);
}
