#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
using namespace std;
int main() {
  long long n;
  string s;
  cin >> n >> s;
  vector<int> v;
  if (n == 1) {
    cout << 0;
    return 0;
  }
  long long w = 0;
  long long b = 0;
  int f = 0;
  long long p = 1;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i + 1] == s[i])
      p++;
    else {
      v.push_back(p);
      p = 1;
    }
  }
  long long ans0 = 0;
  long long ans1 = 0;
  if (s[0] == '.') {
    int j = 1;
    while (j + 1 <= n - 1) {
      ans0 += min(v[j], v[j + 1]);
      j += 2;
    }
    cout << ans0;
  } else {
    int j = 0;
    while (j + 1 <= n - 1) {
      ans1 += min(v[j], v[j + 1]);
      j += 2;
    }
    cout << ans1;
  }
}
