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