#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;
  bool black = false;
  int i = 0;
  while (s[i] != '#' && i < n) i++;
  int b = 0, w = 0;
  for (; i < n; i++) {
    if (s[i] == '#') {
      b++;
    } else {
      w++;
    }
  }
  int ans = min(b, w);
  cout << ans << endl;
  return 0;
}
