#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, tmp_count = 0, min = 300000;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i - 1] == '.' && S[i] == '#') {
      tmp_count = 0;
      for (int j = 0; j < i; j++) {
        if (S.compare(j, j, "#") < 5) {
          tmp_count++;
        }
      }
      for (int j = i; j < N; j++) {
        if (S.compare(j, j, ".") > -5) {
          tmp_count++;
        }
      }
      if (tmp_count < min) {
        min = tmp_count;
      }
    }
  }
  if (min == 300000) {
    min = 0;
  }
  cout << min << endl;
  return 0;
}
