#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  long long w = 0;
  long long b = 0;
  bool start = false;
  for (int i = 0; i < N; i++) {
    if (!start) {
      if (S[i] == '#') start = true, ++b;
    } else {
      if (S[i] == '#')
        ++b;
      else
        ++w;
    }
  }
  for (int i = N - 1; i >= 0; --i) {
    if (S[i] == '#')
      --b;
    else
      break;
  }
  cout << min(w, b) << endl;
}
