#include <bits/stdc++.h>
int main() {
  int N, ansr, ansl;
  char *S, *temp;
  ansr = 0;
  ansl - 0;
  std::cin >> N;
  S = new char[N];
  for (int i = 0; i < N; i++) {
    std::cin >> S[i];
  }
  std::strcpy(temp, S);
  for (int i = 0; i < N - 1; i++) {
    if ((temp[i] == '#') && (temp[i + 1] == '.')) {
      temp[i + 1] = '#';
      ansr++;
    }
  }
  std::strcpy(temp, S);
  for (int i = N - 1; i > 0; i--) {
    if ((temp[i] == '.') && (temp[i - 1] == '#')) {
      temp[i + 1] = '.';
      ansl++;
    }
  }
  if (ansr <= ansl) {
    std::cout << ansr << std::endl;
  } else {
    std::cout << ansl << std::endl;
  }
  delete[] S;
  return 0;
}
