#include <bits/stdc++.h>
using namespace std;
long long n;
char s[200000 + 4];
int main() {
  scanf("%lld \n %s", &n, s);
  long long white = 0;
  long long ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') white++;
    if (s[i] == '#' && white > 0) {
      ans += white;
      white = 0;
    }
  }
  printf("%lld\n", ans);
}
