#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  s = "." + s + "#";
  n += 2;
  vector<int> w = vector<int>(n);
  vector<int> b = vector<int>(n);
  int b_count = 0;
  int w_count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      b_count++;
    }
    if (s[i - 1] == '#') {
      w_count++;
    }
    b[i] = b_count;
    w[n - i - 1] = w_count;
  }
  int result = w[1] + b[1] - 1;
  for (int i = 1; i < n - 1; i++) {
    result = min(result, w[i] + b[i] - 1);
  }
  cout << result << endl;
  return 0;
}
