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