#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  long long black = 0, white = 0, ans = N;
  for (long long j = 0; j < N; ++j) {
    if (S[j] == '#') {
      black += 1;
    } else {
      white += 1;
    }
  }
  long long tb = 0, tw = 0;
  for (long long j = 0; j < N; ++j) {
    if (S[j] == '#') {
      tb += 1;
    } else {
      tw += 1;
    }
    ans = min(ans, tb + (white - tw));
  }
  cout << ans << endl;
  return 0;
}
