#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int wtot = 0;
  for (size_t i = 0; i < (N); ++i) {
    if ('.' == S[i]) {
      ++wtot;
    }
  }
  int ans = numeric_limits<int>::max();
  int wnum = 0, bnum = 0;
  for (size_t i = 0; i < (N); ++i) {
    if ('.' == S[i]) {
      ++wnum;
    } else {
      ++bnum;
    }
    int rightcnt = wtot - wnum;
    ans = min(ans, bnum + rightcnt);
  }
  cout << ans << endl;
  return 0;
}
