#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  string S;
  cin >> n >> S;
  int bl[n + 1], wl[n + 1];
  int b = 0, w = 0;
  int ans = 1000000000;
  for (int i = 0; i < n; i++) {
    if (S[i] == '.')
      w++;
    else
      b++;
    wl[i] = w;
    bl[i] = b;
  }
  wl[n] = w, bl[n] = b;
  for (int i = 0; i < n + 1; i++) {
    int an = bl[i] + (w - wl[i]);
    ans = min(ans, an);
  }
  cout << ans << endl;
}
