#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int w = 0;
  int rw = 0;
  for (int i = n - 1; i >= 0; i--) {
    const char c = s[i];
    if (c == '.') {
      rw++;
    } else if (c == '#') {
      w += rw;
      rw = 0;
    }
  }
  cout << w << endl;
  return 0;
}
