#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int num = 0, f = 0;
  for (int i = 0; i < n - 1; i++) {
    if (f == 0 && s[i] == '.') {
      f = 1;
      num += i;
    }
    if (s[i] == '#' && s[i + 1] == '.' && f == 1) num++;
  }
  cout << num << endl;
  return 0;
}
