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