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