#include <bits/stdc++.h>
int main() {
  std::string S;
  long N;
  std::cin >> N >> S;
  int cnt = 0;
  int contN, countM;
  bool first = true;
  for (long i = 0; i < N; i++) {
    if (S[i] == '#') {
      contN++;
    } else {
      countM++;
    }
    if (S[i] == '#' && first) {
      first = false;
    }
    if (S[i] == '.' && !first) {
      cnt++;
    }
  }
  int cntW = 0;
  bool fist = true;
  for (long i = N - 1; i >= 0; i--) {
    if (S[i] == '.' && fist) {
      fist = false;
    }
    if (S[i] == '#' && !fist) {
      cntW++;
    }
  }
  int ans = std::min(cnt, cntW);
  std::cout << ans << std::endl;
  return 0;
}
