#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, count = 0;
  string b;
  cin >> a >> b;
  for (int i = 0; i < a - 1; i++) {
    if (b.at(i) == '#' && b.at(i + 1) == '.') {
      b.at(i) = '.';
      count++;
    }
  }
  cout << count << endl;
}
