#include <bits/stdc++.h>
int main(void) {
  int n, m, count = 0, count1 = 0;
  scanf("%d", &n);
  char s;
  int flag[n];
  int i;
  int u = 0;
  for (i = 0; i < n; i++) {
    scanf(" %c", &s);
    if (s == '#') {
      flag[i] = 1;
      u++;
    } else {
      flag[i] = 0;
    }
  }
  for (i = 0; i < n; i++) {
    if (flag[i] == 1) {
      break;
    }
  }
  for (int m = i; m < n; m++) {
    if (flag[m] == 0) {
      count++;
    }
  }
  for (m = (n - 1); m >= 0; m--) {
    if (flag[m] == 0) {
      break;
    }
    u--;
  }
  if (count < u) {
    printf("%d\n", count);
  } else {
    printf("%d\n", u);
  }
  return 0;
}
