#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
int main() {
  long long n, k;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> S(n + 1);
  vector<long long> A(n + 1);
  S[0] = 0;
  for (long long i = 0; i < (n); i++) {
    if (s[i] == '#') S[i + 1] = 1;
    S[i + 1] += S[i];
  }
  long long ans = min(S[n], n - S[n]);
  long long tmp = 0;
  for (long long i = 0; i < (n); i++) {
    tmp = S[i + 1];
    tmp += n - (i + 1) + S[n] - S[i + 1];
    ans = min(ans, tmp);
  }
  cout << ans << endl;
}
