#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int ans = 0;
  char now, old;
  cin >> n;
  cin >> old;
  for (int i = 2; i <= n; i++) {
    cin >> now;
    if (now == '.' && old == '#') {
      ans++;
      old = '#';
    } else {
      old = now;
    }
  }
  cout << ans << endl;
}
