#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> rev_accum_w(n + 1, 0);
  for (int i = n; i >= 1; i--) {
    if (s[i - 1] == '.') rev_accum_w[i]++;
    if (i == n) continue;
    rev_accum_w[i] += rev_accum_w[i + 1];
  }
  vector<int> accum_b(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] == '#') accum_b[i]++;
    accum_b[i] += accum_b[i - 1];
  }
  int ans = 100000000;
  for (int i = 1; i <= n; i++) {
    int tmp = 0;
    tmp += accum_b[i];
    tmp += rev_accum_w[i];
    ans = min(ans, tmp);
  }
  cout << min(0, ans - 1) << endl;
  return 0;
}
