#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long INF = ~(1LL << 63);
long long powM(long long base, long long exp) {
  long long ret = 1;
  long long buf = base;
  while (exp > 0) {
    if (exp & 1) {
      ret *= buf;
    }
    buf = buf * buf % MOD;
    exp >>= 1;
  }
  return ret;
}
long long combM(long long a, long long b) {
  if (b == 0) {
    return 1;
  }
  if (a - b < b) {
    return combM(a, a - b);
  }
  long long ans = 1;
  for (long long i = 1; i < b + 1; i++) {
    ans *= a + 1 - i;
    ans /= i;
  }
  return ans;
}
void solve();
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
void solve() {
  long long in;
  string a;
  cin >> in >> a;
  bool w = true;
  long long ans = a.length();
  long long blk = 0;
  long long wht = 0;
  for (long long i = 0; i < in; i++) {
    if (w && a[i] == '.') {
      continue;
    }
    w = false;
    if (a[i] == '.') {
      wht++;
    }
  }
  ans = min(ans, wht);
  bool b = true;
  for (long long i = a.length() - 1; i >= 0; i--) {
    if (b && a[i] == '#') {
      continue;
    }
    b = false;
    if (a[i] == '#') {
      blk++;
    }
  }
  ans = min(ans, blk);
  cout << ans << endl;
}
