#include <bits/stdc++.h>
int main(void) {
  int N;
  std::cin >> N;
  std::string S;
  std::cin >> S;
  std::vector<int> siro(N + 2);
  siro[0] = 0;
  if (S[0] == '#')
    siro[1] = 1;
  else
    siro[1] = 0;
  for (int i = 1; i < N + 1; i++) {
    if (i == N) siro[N + 1] = siro[N];
    if (S[i] == '#')
      siro[i + 1] = siro[i] + 1;
    else
      siro[i + 1] = siro[i];
  }
  std::vector<int> kuro(N + 2);
  kuro[N + 1] = 0;
  if (S[N - 1] == '.')
    kuro[N] = 1;
  else
    kuro[N] = 0;
  for (int i = N - 2; i >= 0; i--) {
    if (S[i] == '.')
      kuro[i + 1] = kuro[i + 2] + 1;
    else
      kuro[i + 1] = kuro[i + 2];
  }
  kuro[0] = kuro[1];
  int min_ = 999999999;
  for (int i = 0; i < N + 2; i++) {
    min_ = std::min(min_, siro[i] + kuro[i]);
  }
  std::cout << min_ << std::endl;
  return 0;
}
