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