#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  s = s + 'f';
  vector<int> a;
  int p = 1;
  for (int i = 0; i < n; i++) {
    if (s[i] == s[i + 1])
      p++;
    else {
      a.push_back(p);
      p = 1;
    }
  }
  int ans = 0;
  if (s[0] == '.') {
    for (int i = 1; i < a.size(); i += 2) {
      int res = 0;
      for (int j = i + 1; j < a.size(); j += 2) res += a[j];
      ans += min(a[i], res);
    }
  } else {
    for (int i = 0; i < a.size(); i += 2) {
      int res = 0;
      for (int j = i + 1; j < a.size(); j += 2) res += a[j];
      ans += min(a[i], res);
    }
  }
  cout << ans << endl;
}
