#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i;
  cin >> n;
  vector<char> s(n);
  vector<int> ps(n);
  for (i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == '.') {
      ps[i] = 0;
    } else {
      ps[i] = 1;
    }
  }
  long int cnt;
  vector<int> d(0);
  i = 0;
  while (i < n) {
    cnt = 0;
    if (ps[i] == 0) {
      while ((ps[i] == 0) && (i < n)) {
        i++;
        cnt++;
      }
    } else {
      while (ps[i] == 1) {
        i++;
        cnt++;
      }
    }
    d.push_back(cnt);
  }
  long long ans;
  long long a, b;
  a = 0;
  b = 0;
  if (ps[0] == 1) {
    for (i = 0; i + 1 < d.size(); i += 2) {
      a += d[i];
      b += d[i + 1];
    }
  } else {
    for (i = 1; i + 1 < d.size(); i += 2) {
      a += d[i];
      b += d[i + 1];
    }
  }
  if (a > b) {
    ans = b;
  } else {
    ans = a;
  }
  cout << ans << endl;
}
