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