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