#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  vector<int> arr_shiro(int(2 * 10e5 + 1), 0);
  vector<int> arr_kuro(int(2 * 10e5 + 1), 0);
  int shiro = 0;
  int kuro = 0;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    string t(1, s[i]);
    if (t == ".") {
      shiro += 1;
    } else {
      kuro += 1;
    }
    arr_shiro[i] = shiro;
    arr_kuro[i] = kuro;
  }
  int diff_min = 2 * 10e5 + 1;
  for (int i = 0; i < n; i++) {
    int diff = 0;
    diff += arr_kuro[i];
    diff += (shiro - arr_shiro[i]);
    if (diff < diff_min) {
      diff_min = diff;
    }
  }
  cout << diff_min << endl;
  return 0;
}
