#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int N;
  cin >> N >> S;
  char bef = S[N - 1];
  long long cnt = 0;
  for (long long i = N - 2; i >= 0; i--) {
    if (S[i] == '#' and S[i] != bef) {
      bef = '.';
      cnt++;
    } else {
      bef = S[i];
    }
  }
  bef = S[0];
  long long ans = cnt;
  cnt = 0;
  for (long long i = 1; i < N; i++) {
    if (S[i] == '.' and S[i] != bef) {
      bef = '#';
      cnt++;
    } else {
      bef = S[i];
    }
  }
  cnt = min(cnt, ans);
  cout << cnt << endl;
}
