#include <bits/stdc++.h>
using namespace std;
void _main();
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  _main();
}
const int inf = INT_MAX / 2;
const long long infl = 1LL << 60;
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;
}
void _main() {
  int N;
  string S;
  cin >> N >> S;
  int phase = 0, white = 0, black = 0;
  int ans = 0;
  for (int i = N - 1; i >= 0; i--) {
    switch (phase) {
      case 0: {
        if (S[i] == '.') {
          ans += min(white, black);
          white = 1;
          phase = 1;
        } else {
          ++black;
        }
      } break;
      case 1: {
        if (S[i] == '.') {
          ++white;
        } else {
          black = 1;
          phase = 0;
        }
      } break;
    }
  }
  if (phase == 0) {
    ans += min(white, black);
  }
  cout << ans << endl;
}
