#include <bits/stdc++.h>
int main(int argc, const char *argv[]) {
  int N;
  std::string S;
  std::cin >> N >> S;
  int count1 = 0;
  int i = 0;
  while (i < N && S[i] != '#') {
    ++i;
  }
  while (i < N) {
    if (S[i] == '.') {
      ++count1;
    }
    ++i;
  }
  int count2 = 0;
  for (int j = 0; j < N; j++) {
    if (S[j] == '#') ++count2;
  }
  int ans = (count1 < count2) ? count1 : count2;
  std::cout << ans << std::endl;
}
