#include <bits/stdc++.h>
int main() {
  int N;
  scanf("%d", &N);
  char S[N];
  scanf("%s", S);
  int ans = N;
  for (int i = 0; i < N - 1; i++) {
    int count = 0;
    for (int j = 0; j < i + 1; j++) {
      if (S[j] == '#') {
        count++;
      }
    }
    for (int k = i + 1; k < N; k++) {
      if (S[k] == '.') {
        count++;
      }
    }
    if (ans > count) {
      ans = count;
    }
  }
  int w_count = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      w_count++;
    }
  }
  if (w_count < ans) {
    ans = w_count;
  }
  int b_count = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      b_count++;
    }
  }
  if (b_count < ans) {
    ans = b_count;
  }
  printf("%d", ans);
  return 0;
}
