#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, count = 0;
  char prev, curr;
  cin >> N;
  cin >> prev;
  for (int i = 0; i < N - 1; i++) {
    cin >> curr;
    if (prev == '#' && curr == '.') {
      count++;
      curr = '#';
    }
    prev = curr;
  }
  cout << count;
}
