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