#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int counter = 0;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      counter++;
    else
      vec.at(i) += counter;
  }
  for (int i = 0; i < n; i++) {
    if (vec.at(i) != 0) {
      cout << counter - vec.at(i) << endl;
      break;
    }
  }
}
