#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool flag = false;
  int ans = 0;
  int ans2 = 0;
  string tmp = "#.";
  for (int i = 0; i < (int)(n); i++) {
    if (flag) {
      if (s[i] == tmp[0])
        continue;
      else {
        ans++;
        flag = false;
      }
    }
    if (s[i] == tmp[0]) flag = true;
  }
  for (int i = 0; i < (int)(n - 1); i++) {
    if (s[i] == tmp[0]) ans2++;
  }
  if (ans > ans2) ans = ans2;
  cout << ans << endl;
}
