#include <bits/stdc++.h>
int main() {
  int N;
  std::string str;
  std::cin >> N;
  std::cin >> str;
  int count = 0;
  for (int i = 0; i < N - 1; i++) {
    if (str[i] == '#' && str[i + 1] == '.') count++;
  }
  std::cout << count << std::endl;
  return 0;
}
