#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
void Main() {
  ll N;
  cin >> N;
  string S;
  cin >> S;
  ll b_cnt = 0, w_cnt = 0;
  vector<ll> B(N + 1), W(N + 1);
  for (ll i = 0; i < (ll)(S.size() + 1); i++) {
    if (i > 0 && S[i] == '#') {
      b_cnt++;
    } else {
      w_cnt++;
    }
    B.at(i) = b_cnt;
    W.at(i) = w_cnt;
  }
  ll ans = INF;
  for (ll i = 0; i < (ll)(S.size() + 1); i++) {
    ll tmp = B.at(i) + (w_cnt - W.at(i));
    if (tmp < ans) {
      ans = tmp;
    }
  }
  cout << ans << endl;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
  return 0;
}
