#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  bool flag = false;
  int cntw = 0;
  int cntb = 0;
  int nowb = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '.') {
      if (flag) cntw++;
      cntb += nowb;
      nowb = 0;
    } else {
      flag = true;
      nowb++;
    }
  }
  cout << min(cntb, cntw) << endl;
}
