#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int ansa = 0;
  int ansb = 0;
  char now, old;
  cin >> n;
  cin >> old;
  if (old == '#') ansb++;
  for (int i = 2; i <= n; i++) {
    cin >> now;
    if (now == '#') ansb++;
    if (now == '.' && old == '#') {
      ansa++;
      old = '#';
    } else {
      old = now;
    }
  }
  cout << min(ansa, ansb) << endl;
}
