#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  string s;
  cin >> n;
  cin >> s;
  vector<long long> sums(n + 1, 0), sumb(n + 1, 0);
  long long ans = 10e17, cntlast = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') {
      sums[i + 1] = sums[i] + 1;
      sumb[i + 1] = sumb[i];
    } else {
      sumb[i + 1] = sumb[i] + 1;
      sums[i + 1] = sums[i];
    }
  }
  bool flag = false;
  int pre = 0;
  for (int i = 0; i < n; ++i) {
    long long tmp = 10e17;
    if (s[i] == '#' and !flag) {
      flag = true;
      pre = i;
    } else if (s[i] == '#' and flag) {
      tmp = sumb[i] + sums[n] - sums[i + 1];
      tmp = min(sums[i] + sums[n] - sums[i], tmp);
      tmp = min(tmp, sumb[i] + sumb[n] - sumb[i]);
      pre = i;
    }
    ans = min(ans, tmp);
  }
  if (ans == 10e17) ans = 0;
  cout << ans << endl;
}
