#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char s[200010];
  cin >> n;
  cin.getline(s, n + 10);
  cin.getline(s, n + 10);
  int count = 0;
  char prev = s[0];
  for (int i = 1; i < n; i++) {
    if (prev == '#' && s[i] == '.') count++;
    prev = s[i];
  }
  cout << count << endl;
  return 0;
}
