#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int main() {
  int n, w = 0, b = 0, ans = 0;
  char str[200005];
  n = read();
  scanf("%s", str);
  for (int i = 0; i <= n; i++) {
    if (str[i] == '.') {
      w++;
    } else {
      if (w) {
        ans += w > b ? b : w;
        w = b = 0;
      }
      b++;
    }
  }
  printf("%d", ans);
  return 0;
}
