#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int N;
  string S;
  cin >> N >> S;
  int white_array[N];
  int black_array[N];
  int white_count = 0, black_count = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      white_count++;
      if (i == 0) {
        white_array[0] = 1;
        black_array[0] = 0;
      } else {
        white_array[i] = white_array[i - 1] + 1;
        black_array[i] = black_array[i - 1];
      }
    } else {
      black_count++;
      if (i == 0) {
        black_array[0] = 1;
        white_array[0] = 0;
      } else {
        white_array[i] = white_array[i - 1];
        black_array[i] = black_array[i - 1] + 1;
      }
    }
  }
  int reverse_count = INT_MAX;
  for (int i = 0; i < N + 1; i++) {
    if (i == 0) {
      reverse_count = min(reverse_count, white_count);
    } else if (i == N) {
      reverse_count = min(reverse_count, black_count);
    } else {
      reverse_count = min(
          reverse_count, black_array[i - 1] + white_count - white_array[i - 1]);
    }
  }
  cout << reverse_count << endl;
}
