#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T>
void view(const std::vector<T> &v) {
  for (const auto &e : v) {
    std::cout << e << " ";
  }
  std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T>> &vv) {
  for (const auto &v : vv) {
    view(v);
  }
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  ll whiteTotal = 0;
  for (int i = 0; i < n; ++i) whiteTotal += (s[i] == '.');
  ll ans = INT32_MAX;
  ll b = 0, w = 0;
  for (int i = 0; i < n; ++i) {
    b += (s[i] == '#');
    w += (s[i] == '.');
    ans = min(ans, b + whiteTotal - w);
  }
  cout << ans << endl;
  return 0;
}
