#include <bits/stdc++.h>
int main() {
  int N;
  std::string str;
  std::cin >> N;
  std::cin >> str;
  int dotcount = 0;
  int sharpcount = 0;
  int min = 2e5;
  for (int i = 0; i < N; i++) {
    dotcount = 0;
    sharpcount = 0;
    for (int k = 0; k < i; k++) {
      if (str[k] == '#') sharpcount++;
    }
    for (int k = i; k < N; k++) {
      if (str[k] == '.') dotcount++;
    }
    if (min >= (dotcount + sharpcount)) {
      min = dotcount + sharpcount;
    }
  }
  for (int i = 0; i < N; i++) {
    if (str[i] == '#') sharpcount++;
    if (min >= sharpcount) min = sharpcount;
  }
  std::cout << min << std::endl;
  return 0;
}
