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