#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  bool s[N];
  int min = 100000000;
  for (int i = 0; i < N; i++) {
    char tmp;
    cin >> tmp;
    if (tmp == '.') {
      s[i] = true;
    } else {
      s[i] = false;
    }
  }
  int count = 0;
  for (int j = 0; j < N; j++) {
    if (s[j] == false) {
      count++;
    }
  }
  if (count < min) {
    min = count;
  }
  for (int i = 1; i < N; i++) {
    if (s[i - 1] != s[i]) {
      count = 0;
      for (int j = 0; j < N; j++) {
        if (j < i) {
          if (s[j] == false) {
            count++;
          }
        } else {
          if (s[j] == true) {
            count++;
          }
        }
      }
      if (count < min) {
        min = count;
      }
    }
  }
  for (int j = 0; j < N; j++) {
    if (s[j] == true) {
      count++;
    }
  }
  if (count < min) {
    min = count;
  }
  cout << min << endl;
}
