#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char a[200005];
  int b[200005], c[200005];
  scanf("%d", &n);
  memset(b, 0, sizeof(b));
  memset(c, 0, sizeof(c));
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == '.') {
      b[i] = 1;
      c[i] = 1;
    }
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i < n; i++) {
    if (b[i - 1] == 0 && b[i] == 1) {
      cnt1++;
      b[i] = 0;
      i = 0;
    }
  }
  for (int i = 1; i < n; i++) {
    if (c[i - 1] == 0 && c[i] == 1) {
      cnt2++;
      c[i - 1] = 1;
      i = 0;
    }
  }
  int m = cnt1 < cnt2 ? cnt1 : cnt2;
  printf("%d", m);
  return 0;
}
