#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 = S.find_first_of('#');
  if (i == std::string::npos) {
    std::cout << 0 << std::endl;
    return 0;
  }
  while (i < N) {
    count1 += (S[i] == '.');
    ++i;
  }
  int count2 = std::count(S.begin(), S.end(), '#');
  std::cout << std::min(count1, count2) << std::endl;
}
