#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::string S;
  std::cin >> S;
  int b = 0, w = 0;
  if (S[0] == '#') ++b;
  for (int i = 1; i < N - 1; ++i) {
    if (S[i] == '#')
      ++b;
    else
      ++w;
  }
  if (S[N - 1] == '.') ++w;
  std::cout << std::min(b, w) << std::endl;
}
