#include <bits/stdc++.h>
int main() {
  int n;
  char s[1000];
  scanf("%d", &n);
  scanf("%s", &s);
  char s1[1000];
  char s2[1000];
  int i = 0;
  int j = 0;
  for (i = 0; i < n; i++) {
    s1[i] = s[i];
    s2[i] = s[i];
  }
  i = 0;
  int ans1 = 0;
  int ans2 = 0;
  for (i = 0; i < n; i++) {
    if ((s1[i] == '#') && (s1[i + 1] == '.')) {
      s1[i + 1] = '#';
      ans1 += 1;
    }
  }
  for (j = 0; j < n; j++) {
    if ((s2[j] == '#') && (s2[j + 1] == '.')) {
      s2[j] = '.';
      ans2 += 1;
    }
  }
  if (ans1 <= ans2) {
    printf("%d\n", ans1);
  } else if (ans1 > ans2) {
    printf("%d\n", ans2);
  }
  return 0;
}
