#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> bw;
  int tmp = 0;
  for (int i = 0; i < N; i++) {
    if ((i == 0) && (S.at(i) == '.')) {
      bw.push_back(0);
      tmp = 1;
    } else if ((i == 0) && (S.at(i) == '#')) {
      tmp++;
    } else if (S.at(i - 1) == S.at(i)) {
      tmp++;
      if (i == N - 1) {
        bw.push_back(tmp);
      }
    } else {
      bw.push_back(tmp);
      tmp = 1;
      if (i == N - 1) {
        bw.push_back(tmp);
      }
    }
  }
  if (bw.size() == 1) {
    cout << "0" << endl;
    return 0;
  }
  int white = 0, black = 0;
  if (bw.size() % 2) {
    for (int i = 0; i < bw.size() - 1; i++) {
      if (i % 2) {
        if ((i == 1) && (bw.at(0) == 0)) {
        } else {
          white += bw.at(i);
        }
      } else {
        black += bw.at(i);
      }
    }
  } else {
    for (int i = 0; i < bw.size(); i++) {
      if (i % 2) {
        white += bw.at(i);
      } else {
        black += bw.at(i);
      }
    }
  }
  if (black < white) {
    cout << black << endl;
  } else {
    cout << white << endl;
  }
  return 0;
}
