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