#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;
  while (s[count] != '\0') {
    if (s[count] == '#') {
      bla++;
      flag = 1;
    } else if (flag == 0)
      N--;
    count++;
  }
  printf("%d", (bla <= N - bla) ? bla : N - bla);
  return 0;
}
