#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int sumw = count(S.begin(), S.end(), '.');
  int ans = 1 << 30, b = 0, w = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.')
      w++;
    else
      b++;
    ans = min(ans, b + sumw - w);
  }
  cout << ans << endl;
  return 0;
}
