#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n;
  string s;
  cin >> n;
  cin >> s;
  long long count = 0;
  for (long long i = 1; i < n; i++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      s[i] = '#';
      count++;
    }
  }
  cout << count << endl;
}
