#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long a, white = 0, black;
  string inp, inp2;
  cin >> a >> inp;
  inp2 = inp;
  for (int i = 1; i < inp.length(); i++) {
    if (inp[i] == '.' && inp[i - 1] == '#') {
      inp[i] = '#';
      white++;
    }
    if (inp2[i] == '.' && inp2[i - 1] == '#') {
      inp[i - 1] = '.';
      black++;
    }
  }
  (black > white) ? cout << white << endl : cout << black << endl;
  return 0;
}
