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