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