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