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