#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  std::string s;
  std::cin >> s;
  int count = 0, black = 0;
  for (size_t i = 0; i < s.length() - 1; i++) {
    if (s[i] == '#') {
      black++;
    }
    if (s[i] == '#' && s[i + 1] == '.') {
      int white = 0;
      for (size_t j = i + 1; j < s.length(); j++) {
        if (s[j] == '.') {
          white++;
        }
      }
      if (black < white) {
        count += black;
        black = 0;
      } else {
        count += white;
      }
    }
  }
  std::cout << count << std::endl;
  return 0;
}
