#include <bits/stdc++.h>
int main() {
  int n;
  std::string s;
  std::cin >> n;
  std::cin >> s;
  std::vector<int> v(n);
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.')
      v[i] = 0;
    else
      v[i] = 1;
  }
  int n_change = 1141540;
  for (int i = 0; i < n + 1; ++i) {
    int n_change_buf = 0;
    for (int j = 0; j < i; ++j) {
      if (v[j] != 0) ++n_change_buf;
    }
    for (int j = i; j < n; ++j) {
      if (v[j] != 1) ++n_change_buf;
    }
    n_change = (n_change_buf < n_change ? n_change_buf : n_change);
  }
  std::cout << n_change << std::endl;
  return 0;
}
