#include <bits/stdc++.h>
int main(int argc, const char *argv[]) {
  int N;
  std::string S;
  std::cin >> N >> S;
  int num_hash = 0;
  int num_dot = 0;
  for (auto c : S) {
    num_hash += (c == '#');
    num_dot += (c == '.');
  }
  int left_dot = 0;
  int right_hash = num_hash;
  int min_count = INT_MAX;
  for (auto c : S) {
    left_dot += (c == '.');
    right_hash -= (c == '#');
    int left_hash_plus_right_dot = num_hash + num_dot - right_hash - left_dot;
    min_count = std::min(min_count, left_hash_plus_right_dot);
  }
  std::cout << min_count << std::endl;
}
