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