#include <bits/stdc++.h>
int main() {
  size_t N;
  std::cin >> N;
  std::string input;
  std::cin >> input;
  size_t flipping{};
  for (size_t idx{}; idx + 1 != input.size(); ++idx) {
    if ((input[idx] == '#') && (input[idx + 1] == '.')) ++flipping;
  }
  std::cout << flipping;
  return 0;
}
