#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 0;
  string S;
  cin >> N;
  cin >> S;
  bool last, now;
  last = now = false;
  int count_b = 0;
  for (int i = 0; i < N; i++) {
    now = S[i] == '#';
    if (last & !now) {
      count_b++;
    }
    last = now;
  }
  last = now = false;
  int count_w = 0;
  for (int i = 0; i < N; i++) {
    now = S[N - i - 1] == '.';
    if (last & !now) {
      count_w++;
    }
    last = now;
  }
  if (count_w > count_b)
    cout << count_b << endl;
  else
    cout << count_w << endl;
}
