#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  std::string str;
  std::cin >> n;
  std::cin >> str;
  int count_white_to_black = 0;
  int count_black_to_white = 0;
  std::string result_str;
  for (int i = 0; i < str.size() - 1; ++i) {
    if (str[i] == '.' && str[i + 1] == '#') {
      result_str.push_back('.');
    }
    if (str[i] == '#' && str[i + 1] == '.') {
      result_str.push_back('#');
      count_black_to_white++;
    }
    if (str[i] == '#' && str[i + 1] == '#') {
      result_str.push_back('#');
    }
    if (str[i] == '.' && str[i + 1] == '.') {
      result_str.push_back('.');
    }
  }
  std::cout << count_black_to_white << endl;
  return 0;
}
