#include <bits/stdc++.h>
using std::min;
int count(char *a, int lwbd, int upbd, char c) {
  int i, count = 0;
  for (i = lwbd; i <= upbd; i++) {
    if (a[i] == c) count++;
  }
  return count;
}
int main(void) {
  int i, N, curr, minVal = 0x7FFFFFFF;
  char x, *a;
  scanf("%d", &N);
  a = new char[N];
  for (i = 0; i < N; i++) {
    scanf("%c", &x);
    if (x == '#')
      a[i] = 0;
    else
      a[i] = 1;
  }
  for (i = 1; i < N - 1; i++) {
    curr = count(a, 0, i, 0) + count(a, i, N, 1);
    if (curr < minVal) minVal = curr;
  }
  printf("%d\n", minVal);
  return 0;
}
