#include <bits/stdc++.h>
using namespace std;
int main() {
  long N;
  cin >> N;
  string s;
  cin >> s;
  int ans1 = 10000000;
  long kuro = 0, siro = 0;
  int a[N][2];
  for (int i = 0; i < N; i++) {
    if (s.at(i) == '#') {
      kuro++;
    }
    a[i][0] = kuro;
  }
  for (int i = N - 1; i >= 0; i--) {
    if (s.at(i) == '.') {
      siro++;
    }
    a[i][1] = siro;
  }
  for (int i = 1; i < N - 1; i++) {
    ans1 = min(ans1, a[i][0] + a[i + 1][1]);
  }
  cout << ans1 << endl;
  return 0;
}
