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