#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  char *A = new char[200010];
  for (int i = 1; i <= N; i++) {
    cin >> A[i];
  }
  int count = 0;
  for (int i = 1; i < N; i++) {
    if (A[i] == '#' && A[i + 1] == '.') {
      count++;
    }
  }
  cout << count;
  return 0;
}
