#include <bits/stdc++.h>
using namespace std;
int main(void) {
  unsigned long N, ret = 0, ret_a = 0;
  string S;
  bool flag = false;
  std::cin >> N >> S;
  for (unsigned long i = 0; i < N; i++) {
    if (S[i] == '#') {
      flag = true;
      ret_a++;
    } else if (S[i] == '*' && flag) {
      ret++;
    }
  }
  if (ret_a < ret)
    std::cout << ret_a << std::endl;
  else
    std::cout << ret << std::endl;
  return 0;
}
