#include <bits/stdc++.h>
int main() {
  int N;
  int flag = 0;
  int whitecount = 0;
  int blackcount = 0;
  std::string S;
  std::cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      flag = 1;
    }
    if (flag == 1) {
      if (S[i] == '.') {
        whitecount++;
      } else {
        blackcount++;
      }
    }
  }
  if (blackcount < whitecount) {
    std::cout << blackcount << std::endl;
  } else {
    std::cout << whitecount << std::endl;
  }
}
