#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N;
  string S;
  cin >> N;
  cin >> S;
  long long sum = 0;
  char hidari = '.';
  for (long long i = 0; i < (long long)(N); i++) {
    if (S[i] == '.') {
      if (hidari == '#') {
        sum++;
        hidari = '#';
      } else {
        hidari = '.';
      }
    } else {
      hidari = '#';
    }
  }
  cout << sum << endl;
  return 0;
}
