#include <bits/stdc++.h>
int main() {
  int n, i, j, f, q, r;
  char s[200001];
  int c[200002] = {}, m = 1;
  scanf("%d%s", &n, s);
  r = n;
  for (i = 0; i < n - 1; i++) {
    c[m]++;
    if (s[i] != s[i + 1]) m++;
  }
  if (s[n - 1] != s[n]) c[m]++;
  if (s[0] == '#')
    i = f = 0;
  else
    i = f = 1;
  for (; i <= m + 1; i += 2) {
    q = 0;
    for (j = f + 1; j < i; j += 2) q += c[j];
    for (j = i + 2; j <= m; j += 2) q += c[j];
    if (q < r) r = q;
  }
  printf("%d", r);
  return 0;
}
