#include <bits/stdc++.h>
int main() {
  size_t N;
  std::cin >> N;
  std::string buf;
  std::cin >> buf;
  const char* S = buf.c_str();
  bool exist0 = false;
  bool exist1 = false;
  std::vector<size_t> vec;
  for (size_t i = 0; i < N; i++) {
    if (S[i] == '#') {
      exist1 = true;
      vec.emplace_back(1);
    } else {
      exist0 = true;
      vec.emplace_back(0);
    }
  }
  if (N == 1 || (!exist1 && exist0) || (exist1 && !exist0)) {
    std::cout << 0 << std::endl;
    return 0;
  }
  std::vector<size_t> vec1;
  std::copy(vec.begin(), vec.end(), std::back_inserter(vec1));
  std::vector<size_t> vec2;
  std::copy(vec.begin(), vec.end(), std::back_inserter(vec2));
  std::reverse(vec2.begin(), vec2.end());
  std::vector<size_t> vec3;
  std::copy(vec.begin(), vec.end(), std::back_inserter(vec3));
  std::reverse(vec3.begin(), vec3.end());
  size_t result0 = 0;
  for (size_t i = 0; i < vec.size() - 1; i++) {
    if (vec[i] == 1 && vec[i + 1] == 0) {
      result0++;
      vec[i + 1] = 1;
    }
  }
  size_t result1 = 0;
  for (size_t i = 0; i < vec1.size() - 1; i++) {
    if (vec1[i] == 0 && vec1[i + 1] == 1) {
      result1++;
      vec1[i + 1] = 0;
    }
  }
  size_t result2 = 0;
  for (size_t i = 0; i < vec2.size() - 1; i++) {
    if (vec2[i] == 0 && vec2[i + 1] == 1) {
      result2++;
      vec2[i + 1] = 0;
    }
  }
  size_t result3 = 0;
  for (size_t i = 0; i < vec3.size() - 1; i++) {
    if (vec3[i] == 1 && vec3[i + 1] == 0) {
      result3++;
      vec3[i + 1] = 1;
    }
  }
  std::cout << std::min(std::min(result0, result1), std::min(result2, result3))
            << std::endl;
  return 0;
}
