#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using TP = tuple<ll, ll, ll>;
ll MOD = 1e9 + 7;
ll INF = 1LL << 58;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin >> N;
  vector<ll> b(N + 1, 0), w(N + 1, 0);
  char s;
  for (int(i) = 0; (i) < (N); (i)++) {
    cin >> s;
    if (s == '#') {
      b[i]++;
    } else {
      w[i]++;
    }
  }
  for (ll i = 0; i < N - 1; i++) {
    b[i + 1] += b[i];
  }
  for (ll i = N; i > 0; i--) {
    w[i - 1] += w[i];
  }
  ll m = 1e9;
  for (int i = 1; i <= N; i++) {
    m = min(m, b[i - 1] + w[i]);
  }
  cout << m << endl;
  return 0;
}
