#include <bits/stdc++.h>
int main() {
  int n, c, d;
  c = 0;
  d = 0;
  std::string s;
  std::cin >> n;
  std::cin >> s;
  std::vector<int> w, b;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      c = c + 1;
    } else {
      d = d + 1;
    }
    w.push_back(c);
    b.push_back(d);
  }
  int ans = 1000000;
  for (int i = 0; i < n; i++) {
    if (d == 0 || c == 0) {
      ans = 0;
    } else if (ans >= b[i] + w[n - 1] - w[i]) {
      ans = b[i] + w[n - 1] - w[i];
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
