#include <bits/stdc++.h>
int main(void) {
  int n, i, judge = 0, count2 = 0, count = 0;
  char s[200001];
  scanf("%d", &n);
  scanf("%s", s);
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      judge = 1;
      count2++;
    }
    if (judge == 1 && s[i] == '.') count++;
  }
  if (count > count2) count = count2;
  printf("%d\n", count);
  return 0;
}
