#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  vector<bool> isBlack(N);
  for (int i = 0; i < N; i++) {
    isBlack[i] = S[i] == '#';
  }
  int count1 = 0;
  for (int i = 1; i < N; i++) {
    if (isBlack[i] && !isBlack[i - 1]) {
      count1++;
      isBlack[i] = !isBlack[i];
    }
  }
  int count2 = 0;
  for (int i = 0; i < N; i++) {
    if (isBlack[i] && !isBlack[i + 1]) {
      count2++;
      isBlack[i] = !isBlack[i];
    }
  }
  cout << min(count1, count2) << endl;
  return 0;
}
