#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0;
  cin >> n;
  string str;
  cin >> str;
  vector<int> leng(n + 2, 0);
  if (str[n - 1] == '.') str[n] = '#', n++;
  for (int i = 1; i < n; i++) {
    leng[cnt]++;
    if (str[i] != str[i - 1]) cnt++;
  }
  long sum1 = 0, sum2 = 0;
  for (int i = 0; i < cnt; i += 2) sum1 += leng[i];
  for (int i = 1; i < cnt; i += 2) sum2 += leng[i];
  cout << min(sum1, sum2) << endl;
  return 0;
}
