#include <bits/stdc++.h>
int main() {
  int N, br, wl, min;
  char *S;
  std::cin >> N;
  S = new char[N];
  min = N;
  for (int i = 0; i < N; i++) {
    std::cin >> S[i];
  }
  for (int i = 0; i < N - 1; i++) {
    if (S[i] != S[i + 1]) {
      br = 0;
      wl = 0;
      for (int j = i; j >= 0; j--) {
        if (S[j] == '#') {
          wl++;
        }
      }
      for (int j = i + 1; j < N; j++) {
        if (S[j] == '.') {
          br++;
        }
      }
      int tmin = wl + br;
      if (tmin < min) {
        min = tmin;
      }
    }
  }
  std::cout << min << std::endl;
  delete[] S;
  return 0;
}
