#include <bits/stdc++.h>
int count_black(int n, char s[n], int i) {
  int j = i + 1;
  while (s[j] == '#' || j == n - 1) {
    j = j + 1;
  }
  return j - i;
}
int count_white(int n, char s[n], int i) {
  int j = i - 1;
  while (s[j] == '.' || j == n - 1) {
    j = j - 1;
  }
  return i - j;
}
int main(void) {
  int n, ans = 0, i, bl, wh;
  scanf("%d", &n);
  char s[n];
  scanf("%s", &s);
  for (i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      bl = count_black(n, s, i);
      wh = count_white(n, s, i + 1);
      if (bl > wh) {
        ans = ans + wh;
      } else {
        ans = ans + bl;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
