#include <bits/stdc++.h>
int min(int a, int b) {
  if (a >= b) {
    return b;
  } else {
    return a;
  }
}
int main() {
  char buf[1024];
  char S[200010];
  int N;
  fgets(buf, sizeof(buf), stdin);
  sscanf(buf, "%d", &N);
  fgets(S, sizeof(S), stdin);
  int countw = 0;
  int countb = 0;
  for (int i = 0; i < ((int)N); i++) {
    if (S[i] == '.') {
      countw++;
    } else {
      countb++;
    }
  }
  int *cleftb = (int *)malloc(sizeof(int) * N);
  int *crightw = (int *)malloc(sizeof(int) * N);
  if (S[0] == '#') {
    cleftb[0] = 1;
    crightw[0] = countw;
  } else {
    cleftb[0] = 0;
    crightw[0] = countw - 1;
  }
  for (int i = 1; i < ((int)N); i++) {
    if (S[i] == '#') {
      cleftb[i] = cleftb[i - 1] + 1;
      crightw[i] = crightw[i - 1];
    } else {
      cleftb[i] = cleftb[i - 1];
      crightw[i] = crightw[i - 1] - 1;
    }
  }
  int ans = cleftb[0] + crightw[0];
  for (int i = 0; i < ((int)N); i++) {
    ans = min(ans, cleftb[i] + crightw[i]);
  }
  printf("%d\n", ans);
  return 0;
}
