#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string s;
  cin >> N >> s;
  long long nai = -100;
  for (long long i = 0; i < N; i++) {
    if (s[i] == '#') {
      nai = i;
      break;
    }
  }
  if (nai == -100) {
    cout << 0 << endl;
    return 0;
  }
  long long allb = 0;
  for (long long i = nai; i < N; i++) {
    if (s[i] == '.') {
      allb++;
    }
  }
  long long tmp = allb;
  char now = '#';
  for (long long i = nai; i < N; i++) {
    if (now != s[i]) {
      if (tmp < allb) {
        allb = tmp;
      }
    }
    if (s[i] == '#') {
      tmp++;
      now = s[i];
    } else if (s[i] == '.') {
      tmp--;
      now = s[i];
    }
  }
  cout << allb << endl;
}
