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