#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
int main() {
  int N, B_ct = 0, W_ct = 0, min;
  cin >> N;
  min = N;
  char S[2 * 100000];
  for (int i = 0; i < N; i++) {
    cin >> S[i];
    if (S[i] == '.') W_ct++;
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '.')
      W_ct--;
    else
      B_ct++;
    if (min > W_ct + B_ct) min = W_ct + B_ct;
  }
  cout << min;
}
