#include <bits/stdc++.h>
int main() {
  int N;
  std::string S;
  std::cin >> N >> S;
  int wc = 0, bc = 0;
  bool countable = false;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      countable = true;
    }
    if (!countable) {
      continue;
    }
    if (S[i] == '#') {
      bc++;
    } else {
      wc++;
    }
  }
  std::cout << std::min(bc, wc) << std::endl;
}
