#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  string S;
  cin >> N >> S;
  bool F = false;
  long long suma = 0, sumb = 0;
  for (long long i = 0; i < N; i++) {
    if (S[i] == '#') F = true;
    if (F) {
      if (S[i] == '#')
        suma++;
      else
        sumb++;
    }
  }
  cout << min(suma, sumb) << endl;
  return 0;
}
