#include <bits/stdc++.h>
int main(void) {
  int n, i, pre, now, count;
  scanf("%d\n", &n);
  char *s;
  s = (char *)malloc(sizeof(n) * 2);
  count = 0;
  scanf("%s\n", s);
  for (i = 0; i < n; i++) {
    if (i == 0) {
      if (s[i] == '#') pre = 1;
      if (s[i] == '.') pre = (-1);
    }
    if (i != 0) {
      if (s[i] == '#') now = 1;
      if (s[i] == '.') now = (-1);
      if (pre > now) {
        count++;
        now = 1;
      }
      pre = now;
    }
  }
  printf("%d", count);
  free(s);
  return 0;
}
