#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  ll N;
  string S;
  cin >> N;
  cin >> S;
  bool colors[N];
  for (ll i = 0; i < N; ++i) colors[i] = (S[i] == '#');
  ll s = 0;
  ll b = N;
  for (ll i = 0; i < N; ++i) {
    if (colors[i])
      break;
    else
      ++s;
  }
  for (ll i = 0; i < N; ++i) {
    if (colors[N - i - 1])
      --b;
    else
      break;
  }
  ll b2w = 0;
  ll w2b = 0;
  for (ll i = s; i < b; ++i) {
    if (colors[i])
      ++b2w;
    else
      ++w2b;
  }
  cout << min(b2w, w2b) << endl;
  return 0;
}
