#include <bits/stdc++.h>
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
template <class T>
void view(T e) {
  cout << e << endl;
}
template <class T>
void view(const vector<T> &v) {
  for (const auto &e : v) {
    cout << e << " ";
  }
  cout << endl;
}
template <class T>
void view(const vector<vector<T>> &vv) {
  for (const auto &v : vv) {
    view(v);
  }
}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int, int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  s += '@';
  vint compress;
  int ct = 1;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] != s[i + 1]) {
      compress.push_back(ct);
      ct = 1;
    } else
      ct++;
  }
  int start = 1;
  if (s[0] == '.') start = 0;
  int ans = inf;
  int n_com = compress.size();
  for (int i = start; i < n_com - 1; i += 2) {
    int ct_tmp = 0;
    for (int j = i - 1; j >= 0; j -= 2) ct_tmp += compress[j];
    for (int j = i + 2; j < n_com; j += 2) ct_tmp += compress[j];
    ans = min(ans, ct_tmp);
  }
  if (ans == inf) ans = 0;
  cout << ans << endl;
}
