#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 i = 0; i < N; i++) {
    if (s[i] == true) {
      count++;
    }
  }
  min = count;
  for (int i = 0; i < N - 1; i++) {
    if (s[i] == true) {
      count--;
    }
    if (s[i + 1] == false) {
      count++;
    }
    if (min > count) {
      min = count;
    }
  }
  if (s[N - 1] == true) {
    count--;
  }
  if (min > count) {
    min = count;
  }
  cout << min << endl;
}
