#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using namespace std;
using dou = double;
const ll INF = 1LL << 60;
const ll mod = 1000000007;
using graph = vector<vector<ll>>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
ll gcd(ll a, ll b) {
  if (a < b) swap(a, b);
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
bool isp(ll n) {
  bool res = true;
  if (n == 1)
    return false;
  else {
    for (ll i = 2; i * i <= n; i++) {
      if (n % i == 0) {
        res = false;
        break;
      }
    }
    return res;
  }
}
ll fac[510000], finv[510000], inv[510000];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (ll i = 2; i < 510000; i++) {
    fac[i] = fac[i - 1] * i % mod;
    inv[i] = mod - inv[mod % i] * (mod / i) % mod;
    finv[i] = finv[i - 1] * inv[i] % mod;
  }
}
ll COM(ll n, ll k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
ll modpow(ll n, ll m, ll MOD) {
  ll res = 1;
  while (m) {
    if (m & 1) res = (res * n) % MOD;
    m >>= 1;
    n *= n;
    n %= MOD;
  }
  return res;
}
int main() {
  ll N;
  cin >> N;
  string S;
  cin >> S;
  vector<ll> kuro(N);
  for (ll i = 0; i < N; i++) {
    if (S[i] == '#') kuro[i] = 1;
  }
  for (ll i = 0; i < N - 1; i++) kuro[i + 1] += kuro[i];
  ll ans = INF;
  for (ll i = 0; i < N - 1; i++) {
    ll cnt = 0;
    if (S[i] == '.' && S[i + 1] == '#') {
      cnt += kuro[i];
      cnt += (N - i - 1) - (kuro[N - 1] - kuro[i]);
      ans = min(ans, cnt);
    }
  }
  if (ans == INF) ans = 0;
  cout << ans << endl;
}
