#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int bcnt = 0, wcnt = 0, res = INF;
  for (int(i) = 0; (i) < (N); (i)++) {
    if (S[i] == '.') wcnt++;
  }
  for (int(i) = 0; (i) < (N); (i)++) {
    if (S[i] == '.') {
      wcnt--;
    } else {
      bcnt++;
    }
    res = min(res, wcnt + bcnt);
  }
  cout << res << endl;
  return 0;
}
