#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  char s[N];
  scanf("%s", s);
  int count = 0, flag = 0, bla = 0, whi;
  while (count < N) {
    if (s[count] == '#') flag = 1;
    if (flag == 1) {
      if (s[count] == '#')
        bla++;
      else
        whi++;
    }
    count++;
  }
  printf("%d", (bla < whi) ? bla : whi);
  return 0;
}
