#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::string str;
  std::cin >> str;
  std::vector<int> counts(N + 1, 0);
  for (int i = 0; i < N; i++) {
    if (str[i] == '.') counts[0]++;
  }
  for (int i = 0; i < N; i++) {
    if (str[i] == '#') {
      counts[i + 1] = counts[i] + 1;
    } else {
      counts[i + 1] = counts[i] - 1;
    }
  }
  std::cout << *std::min_element(std::begin(counts), std::end(counts))
            << std::endl;
}
