#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  int dot_counter = 0;
  int sharp_counter = 0;
  cin >> n >> s;
  try {
    for (int i = 1; i <= n - 1; i++) {
      if (s.at(i) == '.' &&
          (s.at(i - 1) != s.at(i) || s.at(i) != s.at(i + 1))) {
        dot_counter++;
      }
      if (s.at(i) == '#' &&
          (s.at(i - 1) != s.at(i) || s.at(i) != s.at(i + 1))) {
        sharp_counter++;
      }
    }
    if (dot_counter >= sharp_counter) {
      cout << sharp_counter << endl;
    } else {
      cout << dot_counter << endl;
    }
  } catch (...) {
    cout << 0 << endl;
  }
}
