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