#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, ans;
  string S;
  cin >> N >> S;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    a.at(i) = 0;
  }
  for (int i = 0; i < N - 1; i++) {
    if (S.at(i) == '#')
      a.at(i + 1) = a.at(i) + 1;
    else
      a.at(i + 1) = a.at(i);
  }
  for (int i = 0; i < N - 1; i++) {
    if (a.at(i) != 0) {
      if (a.at(i) == a.at(i + 1)) {
        ans++;
      }
    }
  }
  cout << ans << endl;
}
