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