#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string str;
  cin >> n >> str;
  int count = 0;
  bool found = false;
  for (int i = 0; (i < n); ++i) {
    if (str[i] == '#') {
      found = true;
    }
    if (found && str[i] == '.') {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
