#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecVec = vector<Vec>;
template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
void sonic() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
const ll INF = 1e9 + 1;
const ll LINF = 1e18 + 1;
const ll MOD = 1e9 + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
int main(void) {
  ll n;
  cin >> n;
  string s;
  cin >> s;
  Vec cntW(n), cntB(n);
  for (ll(i) = (0); (i) < (n); ++(i)) {
    if (s[i] == '#') cntB[i]++;
    if (i) cntB[i] += cntB[i - 1];
  }
  for (ll(i) = (n); (i) >= (0); --(i)) {
    if (s[i] == '.') cntW[i]++;
    if (i < n - 1) cntW[i] += cntW[i + 1];
  }
  ll ans = min(cntW[0], cntB[n - 1]);
  for (ll(i) = (0); (i) < (n - 1); ++(i)) chmin(ans, cntW[i] + cntB[i + 1]);
  cout << (ans) << endl;
  return 0;
}
