#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  char state = S[0];
  int count = 0;
  vector<int> count_list;
  for (int i = 0; i < N; i++) {
    if (S[i] == state) {
      count++;
    } else {
      count_list.push_back(count);
      state = S[i];
      count = 1;
    }
  }
  count_list.push_back(count);
  bool start = S[0] == '.' ? false : true;
  if (S[0] == false) {
    if (count_list.size() % 2 == 0) count_list[count_list.size() - 1] = 0;
  } else {
    if (count_list.size() % 2 == 1) count_list[count_list.size() - 1] = 0;
  }
  count = 0;
  if (start == 0) {
    int count_white = 0;
    for (int i = 1; i < count_list.size(); i++) {
      if (i % 2 == 0) count_white += count_list[i];
    }
    int count_black = 0;
    for (int i = 1; i < count_list.size(); i++) {
      if (i % 2 == 1) count_black += count_list[i];
    }
    count = min(count_white, count_black);
  } else {
    int count_black = 0;
    for (int i = 0; i < count_list.size(); i++) {
      if (i % 2 == 0) count_black += count_list[i];
    }
    int count_white = 0;
    for (int i = 0; i < count_list.size(); i++) {
      if (i % 2 == 1) count_white += count_list[i];
    }
    count = min(count_white, count_black);
  }
  cout << count << endl;
  return 0;
}
