#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  int ans = 0;
  char str[] = "#.";
  cin >> n;
  char s[n];
  cin >> s;
  for (int i = 0; i < n - 1; i++) {
    if (strncmp(str, s + i, 2) == 0) {
      strncpy(s + i, "##", 2);
      ans++;
    } else if (strncmp(s + i + 1, ".", 1) == 0) {
      i++;
    }
  }
  cout << ans << endl;
  return 0;
}
