#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S, SW, SB;
  cin >> N;
  cin >> S;
  int b = 0;
  int w = 0;
  SW = S;
  for (int i = (0); i < (SW.length()); i++) {
    if (SW[i] == '.' && i != 0) {
      if (SW[i - 1] == '#') {
        w++;
        SW[i] = '#';
      }
    }
  }
  SB = S;
  for (int i = (0); i < (SB.length()); i++) {
    if (SB[i] == '#' && i != SB.length() - 1) {
      if (SB[i + 1] == '.') {
        b++;
        SB[i] = '.';
      }
    }
  }
  cout << min(w, b) << endl;
}
