#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
inline long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
inline long long lcm(long long a, long long b) { return a * b / GCD(a, b); }
template <class T>
bool contain(const std::string& s, const T& v) {
  return s.find(v) != std::string::npos;
}
using Edge = pair<int, long long>;
using Graph = vector<vector<int>>;
using Edge = pair<int, long long>;
int main() {
  int n;
  cin >> n;
  string S;
  cin >> S;
  S += "E";
  vector<long long> list;
  int cnt = 1;
  for (long long i = 0; i < (long long)n; i++) {
    if (S[i] != S[i + 1]) {
      list.push_back(cnt);
      cnt = 1;
    } else
      cnt++;
  }
  if (S[0] == '.') {
    long long res1 = 0, res2 = 0;
    for (int i = 1; i < (int)list.size(); i++) {
      if (i % 2 == 0)
        res1 += list[i];
      else
        res2 += list[i];
    }
    cout << min(res1, res2) << endl;
  } else {
    long long res1 = 0, res2 = 0;
    for (long long i = 0; i < (long long)n; i++) {
      if (i % 2 == 0)
        res1 += list[i];
      else
        res2 += list[i];
    }
    cout << min(res1, res2) << endl;
  }
}
