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