#include <bits/stdc++.h>
int main(void) {
  int n, count = 0, spos = 0, memo = 0, c1 = 0, c2 = 0;
  char s[4000002];
  if (scanf("%d %s", &n, s) == 1)
    ;
  memo = n;
  while (n > 0 && s[n - 1] == '#') {
    n--;
    memo--;
  }
  while (spos < n && s[spos] == '.') {
    spos++;
    memo--;
  }
  for (int i = spos; i < n; i++) {
    if (s[i] == '#') {
      c1++;
    } else {
      c2++;
    }
  }
  if (c1 > c2) {
    printf("%d", c2);
  } else {
    printf("%d", c1);
  }
  return 0;
}
