#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1000000007;
inline double isint(double a) { return a >= 0 && ceil(a) == floor(a); }
template <typename T>
inline T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
  return a > b && (a = b, true);
}
int main() {
  ll N;
  string S;
  cin >> N >> S;
  vector<ll> shiro(N + 1, 0), kuro(N + 1, 0);
  for (int i = 0; i < (S.size()); i++) {
    if (S[i] == '#') {
      kuro[i + 1] = kuro[i] + 1;
      shiro[i + 1] = shiro[i];
    } else {
      shiro[i + 1] = shiro[i] + 1;
      kuro[i + 1] = kuro[i];
    }
  }
  ll t, minval = 99999999;
  for (int i = 0; i < (N + 1); i++) {
    t = kuro[i] + shiro[N] - shiro[i];
    if (t == 1) {
      std::cout << "i"
                   " = "
                << i << std::endl;
      std::cout << "\"A\""
                   " = "
                << "A" << std::endl;
    }
    chmin(minval, t);
  }
  std::cout << minval << std::endl;
  return 0;
}
