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