#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  string str;
  cin >> str;
  bool judge = 0, judge1 = 0;
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == '.') {
      if (judge == 0) {
        cnt1++;
      }
      judge = 1;
    } else {
      judge = 0;
    }
    if (str[i] == '#') {
      if (judge1 == 0) {
        cnt2++;
      }
      judge1 = 1;
    } else {
      judge1 = 0;
    }
  }
  cout << min(cnt2, cnt1) << '\n';
  return 0;
}
