#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  string s;
  cin >> n >> s;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  long long ans = 0;
  for (size_t i = 1; i < n; i++) {
    if (s.substr(i - 1, 2) == "#.") ans++;
  }
  cout << ans << endl;
}
