#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  string S;
  cin >> N >> S;

  vector<int> cnt_B(N + 1, 0);
  for (int i = 0; i < N; i++) {
    cnt_B[i + 1] = cnt_B[i];
    if (S[i] == '#') cnt_B[i + 1]++;
  }

  int ans = N, cnt = 0;
  for (int i = 0; i < N + 1; i++) {
    int left_B = cnt_B[i];
    int right_W = (N - i) - (cnt_B[N] - cnt_B[i]);
    ans = min(ans, left_B + right_W);
  }

  cout << ans << endl;
}