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