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