#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  char S[2 * 100000 + 10];
  cin >> N >> S;
  long long w = 0;
  long long b = 0;
  long long min_h;
  long long min_b;
  long long min_w;
  for (long long i = 0; i < N; i++) {
    if (S[i] == '.') w++;
  }
  b = N - w;
  min_b = w;
  min_w = b;
  long long dp[2 * 100000 + 10];
  if (S[0] == '.')
    dp[0] = w - 1;
  else
    dp[0] = 1 + w;
  for (long long i = 1; i < N; i++) {
    if (S[i] == '.') {
      dp[i] = dp[i - 1] - 1;
    } else {
      dp[i] = dp[i - 1] + 1;
    }
  }
  for (long long i = 1; i < N; i++) min_h = min(dp[i], dp[i - 1]);
  cout << min(min_h, min(min_b, min_w));
  return 0;
}
