#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int begin = N, end = 0;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#') {
      begin = i;
      break;
    }
  }
  for (int i = N - 1; i >= 0; --i) {
    if (S[i] == '.') {
      end = i + 1;
      break;
    }
  }
  if (begin == end) {
    cout << 0 << endl;
    return 0;
  }
  int min = N;
  for (int i = begin; i < end; ++i) {
    int b = 0, w = 0;
    for (int j = begin; j < i; ++j) {
      if (S[j] == '#') b++;
    }
    for (int j = i; j < end; ++j) {
      if (S[j] == '.') w++;
    }
    min = b + w < min ? b + w : min;
  }
  cout << min << endl;
  return 0;
}
