#include <bits/stdc++.h>
using namespace std;
int N;
string S;
int main() {
  cin >> N >> S;
  int white = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') white++;
  }
  int sum_bw[N + 1];
  sum_bw[0] = white;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.')
      sum_bw[i + 1] = sum_bw[i] - 1;
    else
      sum_bw[i + 1] = sum_bw[i] + 1;
  }
  sort(sum_bw, sum_bw + N + 1);
  cout << sum_bw[0] << endl;
}
