#include <bits/stdc++.h>
using std::min;
int main(void) {
  int i, N, lwbd, c1, c2;
  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;
  }
  i = 0;
  while (a[i] == 1) i++;
  lwbd = i;
  c1 = 0;
  c2 = 0;
  for (i = lwbd; i < N; i++) {
    if (a[i] == 0)
      c1 += 1;
    else
      c2 += 1;
  }
  printf("%d\n", min(c1, c2));
  return 0;
}
