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