#include <bits/stdc++.h>
using namespace std;
long long int i, j, n, m, k, l, q, t, a, b, sum[3], tot[3], cnt[3];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s1 = "#.", s2 = ".#", s;
  cin >> n;
  cin >> s;
  for (i = 0; i < (long long int)s.length(); i++) {
    cnt[0] = s[i] != s1[i % 2] ? cnt[0] + 1 : cnt[0];
    cnt[1] = s[i] != s2[i % 2] ? cnt[1] + 1 : cnt[1];
  }
  cout << min(cnt[0], cnt[1]);
  return 0;
}
