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