#include <bits/stdc++.h>
char S[2 * 100001] = {0};
int main() {
  int N;
  int i = 0;
  int black = 0, white = 0;
  int ans = 0;
  int white_detect = 0;
  scanf("%d", &N);
  scanf("%s", S);
  for (i = (N - 1); 0 <= i; i--) {
    if (S[i] == '#') {
      if (white_detect == 1) {
        black++;
      }
      ans += white;
      white = 0;
    } else {
      white_detect = 1;
      white++;
    }
  }
  if (ans > black) {
    ans = black;
  }
  printf("%d\n", ans);
  return 0;
}
