#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  unsigned long int N;
  string S;
  cin >> N >> S;
  unsigned int mark = UINT_MAX;
  for (unsigned int i = 0; i < N - 1; i++) {
    string sub = S.substr(i, 2);
    string cmp = "#.";
    if (sub == cmp) {
      mark = i + 1;
      break;
    }
  }
  unsigned int mae = 0;
  unsigned int ato = 0;
  if (mark == UINT_MAX) {
    cout << "0" << endl;
  } else {
    for (unsigned int i = 0; i < mark; i++) {
      if (S[i] == '#') {
        mae++;
      }
    }
    for (unsigned int i = mark; i < N; i++) {
      if (S[i] == '.') {
        ato++;
      }
    }
    cout << min(mae, ato) + N - mark - 1 - max(mae, ato) << "\n";
  }
  return 0;
}
