#include <bits/stdc++.h>
using namespace std;
int min(int a, int b) { return (a < b) ? a : b; }
int main() {
  int n, sum = 0, j, num;
  char c;
  string s;
  vector<pair<int, char>> se;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    char c = s[i];
    num = 0;
    j = i;
    while (s[j] == c && j < n) {
      num++;
      j++;
    }
    se.push_back(make_pair(num, c));
    i = j - 1;
  }
  if (se[0].second == '.')
    j = 1;
  else
    j = 0;
  for (; j < se.size() - 1; j += 2) {
    sum += min(se[j].first, se[j + 1].first);
  }
  cout << sum << endl;
}
