#include <bits/stdc++.h>
using namespace std;
int sum_digits(int num);
template <class T>
vector<T> copy_vector(vector<T> vec);
int gcd(int a, int b);
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = n;
  int num_white = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      num_white++;
    }
  }
  int left_black = 0;
  int right_white = num_white;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      right_white--;
    } else {
      left_black++;
    }
    int tmp = right_white + left_black;
    if (cnt > tmp) {
      cnt = tmp;
    }
  }
  cout << cnt << endl;
  return 0;
}
int sum_digits(int num) {
  int rtn = 0;
  while (num != 0) {
    int tmp = num % 10;
    rtn += tmp;
    num /= 10;
  }
  return rtn;
}
template <class T>
vector<T> copy_vector(vector<T> vec) {
  vector<T> rtn;
  rtn.reserve(vec.size());
  copy(vec.begin(), vec.end(), back_inserter(rtn));
  return rtn;
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
