#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  string s;
  cin >> n >> s;
  long long ansA = 0;
  long long ansB = 0;
  long long ansC = -1;
  for (long long i = 0; i < n - 1; i++) {
    if (s.at(i) == '#') {
      ansA++;
    }
  }
  for (long long i = 1; i < n; i++) {
    if (s.at(i) == '.') {
      ansB++;
    }
  }
  int firstSharp = s.find_first_of('#');
  if (firstSharp >= 0) {
    long long ansChikaku = 0;
    for (long long i = firstSharp; i < n; i++) {
      if (s.at(i) == '.') {
        ansChikaku++;
      }
    }
    if (ansC < 0) {
      ansC == ansChikaku;
    } else {
      ansC = min(ansC, ansChikaku);
    }
  }
  if (ansC >= 0) {
    cout << min(ansA, min(ansB, ansC)) << endl;
  } else {
    cout << min(ansA, ansB) << endl;
  }
}
