#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> b(n, 0), w(n, 0);
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '#')
      b[i] = 1;
    else
      w[i] = 1;
  }
  vector<int> sb(n + 1, 0), sw(n + 1, 0);
  for (int i = 0; i < (n); ++i) {
    sb[i + 1] = sb[i] + b[i];
    sw[i + 1] = sw[i] + w[i];
  }
  bool ok = true;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '.') ok = false;
  }
  if (ok) {
    cout << 0 << endl;
    return 0;
  }
  int ans = n;
  for (int i = 0; i < (n); ++i) {
    ans = min(ans, sb[i + 1] + sw[n] - sw[i + 1]);
  }
  cout << ans << endl;
}
