#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, white, ans;
  cin >> N;
  vector<long long> V(N);
  char c;
  cin >> c;
  if (c == '.') V[0] = 1;
  for (long long i = 1; i < N; i++) {
    cin >> c;
    if (c == '.')
      V[i] = V[i - 1] + 1;
    else
      V[i] = V[i - 1];
  }
  white = V[N - 1];
  ans = min(ans, white);
  for (long long i = 0; i < N; i++) {
    ans = min(ans, i + 1 - V[i] + white - V[i]);
  }
  cout << ans << "\n";
}
