#include <bits/stdc++.h>
int main() {
  const int STR_LEN_MAX = 2 * std::pow(10, 5);
  int n;
  char s[STR_LEN_MAX];
  scanf("%d%s", &n, s);
  int white = 0;
  int black = 0;
  int i = 0;
  while (i < n && (s[n - i - 1] == '#')) {
    i++;
  }
  for (; i < n; i++) {
    if (s[n - i - 1] == '.') white++;
    if (s[n - i - 1] == '#') black++;
  }
  int res = 0;
  res = (white < black) ? white : black;
  printf("%d", res);
}
