#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::string S;
  std::cin >> S;
  int a = 0, b = 0;
  for (char c : S) {
    if (c == '#')
      ++a;
    else
      ++b;
  }
  std::cout << std::min(a, b) << std::endl;
}
