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