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