#include <bits/stdc++.h>
int main(void) {
  long long int n, min = 0, i, j, k = 0, temp = 0;
  scanf("%lld", &n);
  char s[n];
  scanf("%s", s);
  long long int stones[n];
  for (i = 0; i < n; i++) stones[i] = 1;
  if (strncmp(&s[0], ".", 1) == 0) {
    stones[0] = 0;
    k++;
    for (i = 0; i < n - 1; i++) {
      if (strncmp(&s[i], &s[i + 1], 1) == 0)
        stones[k]++;
      else
        k++;
    }
    for (i = 1; i <= k; i += 2) min += stones[i];
    for (i = 1; i <= k; i += 2) {
      temp = 0;
      for (j = 0; j < i; j += 2) temp += stones[j];
      for (j = i + 2; j <= k; j += 2) temp += stones[j];
      if (min > temp) min = temp;
    }
  } else {
    for (i = 0; i < n - 1; i++) {
      if (strncmp(&s[i], &s[i + 1], 1) == 0)
        stones[k]++;
      else
        k++;
    }
    for (i = 1; i <= k; i += 2) min += stones[i];
    for (i = 1; i <= k; i += 2) {
      temp = 0;
      for (j = 0; j < i; j += 2) temp += stones[j];
      for (j = i + 2; j <= k; j += 2) temp += stones[j];
      if (min > temp) min = temp;
    }
  }
  printf("%lld", min);
  return 0;
}
