#include <bits/stdc++.h>
int main() {
  int a;
  char tmp;
  static int c[200000] = {};
  int i;
  int lastwhite;
  int blackcnt = 0;
  int whitecnt = 0;
  int sumcnt;
  int mincnt = 200000;
  scanf("%d\n", &a);
  for (i = 0; i < a; i++) {
    scanf("%c", &tmp);
    if (tmp == '#') {
      c[i] = 1;
    } else {
      c[i] = 0;
    }
  }
  for (lastwhite = 0; lastwhite < a; lastwhite++) {
    blackcnt = 0;
    whitecnt = 0;
    for (i = 0; i <= lastwhite; i++) {
      if (((c[i] & 1) == 1)) {
        blackcnt++;
      }
    }
    for (i = lastwhite + 1; i < a; i++) {
      if (((c[i] & 1) == 0)) {
        whitecnt++;
      }
    }
    sumcnt = blackcnt + whitecnt;
    if (mincnt > sumcnt) {
      mincnt = sumcnt;
    }
  }
  printf("%d\n", mincnt);
  return 0;
}
