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