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