#include <bits/stdc++.h>
int main() {
  int n, i, a = 0, b = 0, ans = 20000000;
  char s[200001];
  scanf("%d%s", &n, s);
  int ff = 0, f = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '#')
      b++;
    else
      a++;
  }
  int w = 0, bb = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '#')
      bb++;
    else
      w++;
    ans = ((ans) < (bb + (a - w)) ? (ans) : (bb + (a - w)));
  }
  printf("%d\n", ans);
  return 0;
}
