#include <bits/stdc++.h>
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
using namespace std;
constexpr int MOD = 1000000007;
void print(const std::vector<long long>& v) {
  std::for_each(v.begin(), v.end(), [](long long x) { std::cout << x << " "; });
  std::cout << std::endl;
}
int main() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  vector<long long> b(N, 0), w(N, 0);
  for (long long i = 0; i < (long long)N; i++) {
    if (i > 0) {
      if (S[i] == '#') {
        b[i] = b[i - 1] + 1;
        w[i] = w[i - 1];
      } else {
        b[i] = b[i - 1];
        w[i] = w[i - 1] + 1;
      }
    } else {
      if (S[i] == '#') {
        b[i] = 1;
        w[i] = 0;
      } else {
        b[i] = 0;
        w[i] = 1;
      }
    }
  }
  vector<long long> ans(N, 0);
  for (long long i = 0; i < (long long)N; i++) {
    ans[i] = b[i] + w[N - 1] - w[i];
  }
  cout << *min_element((ans).begin(), (ans).end()) << endl;
}
