#include <bits/stdc++.h>
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
using namespace std;
int main(int argc, char const *argv[]) {
  int n, cnt = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < (int)n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      for (int j = 0; j < (int)n; j++) {
        if (s[i + 1 + j] == '.') cnt++;
        if (i + 1 + j + 1 > n) break;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
