#include <bits/stdc++.h>
int min(int a, int b) { return (a < b) ? a : b; }
int main(void) {
  int N;
  scanf("%d", &N);
  char s[N + 1];
  scanf("%s", s);
  int count = 0;
  int min = N;
  for (int i = 0; i < N + 1; i++) {
    for (int j = 0; j < i; j++) {
      if (s[j] == '#') {
        count += 1;
      }
    }
    for (int j = i; j < N; j++) {
      if (s[j] == '.') {
        count += 1;
      }
    }
    if (count < min) {
      min = count;
    }
    count = 0;
  }
  printf("%d\n", min);
  return 0;
}
