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