#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string S;
  cin >> n;
  cin >> S;
  int ans = 0;
  vector<int> nums;
  if (S[0] == '.') nums.push_back(0);
  for (int i = 0; i < S.size();) {
    int j = i;
    while (j < S.size() && S[j] == S[i]) ++j;
    nums.push_back(j - i);
    i = j;
  }
  if (S.back() == '.') nums.push_back(0);
  if (S[0] == '.') {
    for (int i = 1; 2 * i < nums.size() - 2; i++) {
      if (nums[2 * i - 1] <= nums[2 * i]) {
        ans += nums[2 * i - 1];
      } else {
        ans += nums[2 * i];
      }
    }
  } else {
    for (int i = 0; 2 * i < nums.size() - 1; i++) {
      if (nums[2 * i] <= nums[2 * i + 1]) {
        ans += nums[2 * i];
      } else {
        ans += nums[2 * i + 1];
      }
    }
  }
  cout << ans << endl;
  return 0;
}
