#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string cp = s;
  int lnum = 0, rnum = 0;
  for (int i = 0; i < n - 1; ++i) {
    if (s[i] != s[i + 1]) {
      if (s[i + 1] == '.') {
        s[i + 1] = '#';
        lnum++;
      }
    }
  }
  s = cp;
  for (int i = n - 1; i > 0; --i) {
    if (s[i] != s[i - 1]) {
      if (s[i - 1] == '#') {
        s[i - 1] = '.';
        rnum++;
      }
    }
  }
  int num = (rnum > lnum) ? lnum : rnum;
  cout << num << endl;
  return 0;
}
