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