#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  string s;
  cin >> N >> s;
  vector<long long> vec;
  char prev = s[0];
  long long len = 1;
  for (long long i = 1; i < N; ++i) {
    if (prev == s[i]) {
      ++len;
    } else {
      prev = s[i];
      vec.push_back(len);
      len = 1;
    }
  }
  vec.push_back(len);
  long long start = 0;
  if (s[0] == '.') {
    start = 1;
  }
  long long ans = 0;
  long long size = vec.size();
  for (long long i = start; i < size; i = i + 2) {
    if (i == size - 1) {
      break;
    }
    if (vec[i] < vec[i + 1]) {
      ans += vec[i];
    } else {
      ans += vec[i + 1];
    }
  }
  cout << ans << endl;
}
