#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void display_vec(vector<int> v) {
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << endl;
  }
  cout << endl;
}
int main(int argc, const char *argv[]) {
  int n;
  string s;
  cin >> n >> s;
  if (s.find('.') == -1 || s.find('#') == -1) {
    cout << 0 << endl;
    return 0;
  }
  int a[n];
  if (s[0] == '.') {
    a[0] = 1;
  } else {
    a[0] = 0;
  }
  for (int i = 1; i < n; i++) {
    if (s[i] == '.') {
      a[i] = a[i - 1] + 1;
    } else {
      a[i] = a[i - 1];
    }
  }
  int min = 1000000, cnt;
  for (int i = 0; i < n; i++) {
    cnt = a[n - 1] - a[i] + (i + 1 - a[i]);
    if (cnt < min) {
      min = cnt;
    }
  }
  cout << min << endl;
}
