// Last Change: 04/20/2019 23:32:20.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

namespace NS {
void LoopUntilZeroInpput() {
  int hogegegege = 0;
  while (cin >> hogegegege && hogegegege != 0) {
  }
}
} // namespace NS

const char black = '#';
const char white = '.';

int main() {
  ll N;
  string S;
  cin >> N >> S;

  vector<pair<ll, ll>> ruiseki(N + 1);
  ruiseki[0].first = 0;
  for (ll i = 0, tmp = 0; i < N; ++i) {
    if (S[i] == black) {
      ++tmp;
    }
    ruiseki[i + 1].first = tmp;
  }

  ruiseki[N].second = 0;
  for (ll i = N - 1, tmp = 0; i >= 0; --i) {
    if (S[i] == white) {
      ++tmp;
    }
    ruiseki[i].second = tmp;
  }

  int64_t ans = INT64_MAX;
  for (ll i = 0; i <= N; ++i) {
    ans = min(ans, ruiseki[i].first + ruiseki[i].second);
  }

  cout << ans << endl;

  //NS::LoopUntilZeroInpput();
}
