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