#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  long long ans = 1e10;
  vector<long long> wa(N + 1);
  wa[0] = 0;
  for (int i = 1; i <= N; i++) {
    wa[i] = wa[i - 1];
    if (S[i - 1] == '.') wa[i]++;
  }
  for (int i = 1; i <= N; i++) {
    long long l = wa[i];
    long long r = wa[N] - wa[i];
    ans = min(ans, (i - l) + (r));
  }
  ans = min(wa[N], N - wa[N]);
  cout << ans << endl;
}
