#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const char* LF = "\n";
namespace {
struct _ {
  _() {
    cin.tie(0);
    ios::sync_with_stdio(false);
  }
} a;
}  // namespace
signed main() {
  ll N;
  cin >> N;
  string S;
  cin >> S;
  ll beg = -1;
  for (int i = (0), iLen_ = (N); i < iLen_; i++) {
    if (S[i] == '#') {
      beg = i;
      break;
    }
  }
  if (beg == -1) {
    cout << 0 << LF;
    return 0;
  }
  ll e = N - 1;
  for (ll i = N - 1; i >= 0; i--) {
    if (S[i] == '.') {
      e = i;
      break;
    }
  }
  if (beg <= e) {
    ll ans = 0;
    for (ll i = beg; i <= e; i++) {
      if (S[i] == '.') {
        ans++;
      }
    }
    ll ans2 = 0;
    for (ll i = beg; i <= e; i++) {
      if (S[i] == '#') {
        ans2++;
      }
    }
    cout << min(ans, ans2) << LF;
  } else {
    cout << 0 << LF;
  }
  return 0;
}
