#include <bits/stdc++.h>
int main(void) {
  int N;
  char* S;
  std::cin >> N;
  S = new char[N + 1];
  std::cin >> S;
  bool fb = false;
  int nw = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') fb = true;
    if (fb && S[i] == '.') nw++;
  }
  bool fw = false;
  int nb = 0;
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '.') fw = true;
    if (fw && S[i] == '#') nb++;
  }
  int ans = (nw < nb) ? nw : nb;
  std::cout << ans << "\n";
  return 0;
}
