#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int n;
  int b = 0, w = 0;
  char s[200007];
  scanf("%d %s", &n, s);
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.')
      ++w;
    else
      ++b;
  }
  if (s[0] == '#')
    printf("%d\n", (w < b ? w : b));
  else if (s[0] == '.')
    printf("%d\n", (w > b ? b : w));
  return 0;
}
