#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e9;
const long long MOD = (long long)1e9 + 7;
const long long MAX = 510000;
vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  long long N, ans = INF, B = 0, W = 0;
  string S;
  cin >> N >> S;
  vector<long long> b(N, 0), w(N, 0);
  for (long long i = 0; i < N; i++) {
    if (S[i] == '#') {
      b[i]++;
      B++;
    } else {
      w[i]++;
      W++;
    }
    if (i != N - 1) {
      b[i + 1] = b[i];
      w[i + 1] = w[i];
    }
  }
  for (long long i = 0; i < N; i++) {
    ans = min(ans, b[i] + W - w[i]);
  }
  cout << ans << endl;
}
