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