#include <bits/stdc++.h>
int main() {
  int n;
  std::string s;
  std::cin >> n >> s;
  size_t i = 0;
  size_t count1 = 0;
  for (; i < s.size(); ++i) {
    if (s[i] == '.') {
      count1++;
    }
    if (s[i] == '#') {
      break;
    }
  }
  size_t count2 = 0;
  for (; i < s.size(); ++i) {
    if (s[i] == '.') {
      count2++;
    }
  }
  std::cout << std::min(s.size() - (count1 + count2),
                        std::min(s.size() - count1, count2))
            << std::endl;
}
