#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> B(N), W(N);
  int bcnt = 0, wcnt = 0;
  for (int i = 0; i < int(N); ++i) {
    if (S[i] == '.') {
      wcnt++;
    } else {
      bcnt++;
    }
    W[i] = wcnt;
    B[i] = bcnt;
  }
  int ans = INF;
  for (int i = 0; i < int(N); ++i) {
    int n = 0;
    n += B[i];
    n += wcnt - W[i];
    ans = min(ans, n);
  }
  cout << ans << endl;
}
