#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, w_idx = 0, b_idx = 0;
  cin >> N;
  string S(N, '-'), s(N, '-');
  cin >> S;
  s = S;
  for (int i = 1; i < N; i++) {
    if (S[i - 1] == '#' && S[i] == '.') {
      b_idx++;
    }
    if (s[i - 1] == '#' && s[i] == '.') {
      w_idx++;
    }
  }
  if (w_idx >= b_idx)
    cout << b_idx << endl;
  else
    cout << w_idx << endl;
  return 0;
}
