#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  string S;
  cin >> N >> S;
  string S1 = S;
  string S2 = S;
  int bnum = 0, wnum = 0;
  for (int i = 1; i < N; i++) {
    if (S1[i - 1] == '#' && S1[i] == '.') {
      bnum++;
      S1[i] = '#';
    }
  }
  for (int i = 0; i < N - 1; i++) {
    if (S2[i] == '#') {
      wnum++;
      S2[i] = '.';
    }
  }
  cout << min(bnum, wnum) << endl;
  return 0;
}
