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