#include <bits/stdc++.h>
int main() {
  int n, i, ans = 0, sharp = 0, dot = 0;
  char s[200001];
  scanf("%d %s", &n, s);
  for (i = 0; i < n; i++) {
    if (s[i] == '.') {
      dot++;
      if (s[i + 1] == '#' || i == n - 1) {
        ans += ((dot < sharp) ? (dot) : (sharp));
        dot = 0;
        sharp = 0;
      }
    } else {
      sharp++;
    }
  }
  printf("%d", ans);
  return 0;
}
