#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n;
  cin >> n >> s;
  int ans = 200000;
  int sumw[200000] = {0};
  int sumb[200000] = {0};
  if (s[0] == '#') {
    sumb[0] = 1;
    sumw[0] = 0;
  } else {
    sumw[0] = 1;
    sumb[0] = 0;
  }
  for (int i = 1; i < n; i++) {
    if (s[i] == '.') {
      sumw[i] = sumw[i - 1] + 1;
      sumb[i] = sumb[i - 1];
    } else {
      sumb[i] = sumb[i - 1] + 1;
      sumw[i] = sumw[i - 1];
    }
  }
  for (int i = 0; i < n; i++) {
    ans = min(ans, sumb[i] + sumw[n - 1] - sumw[i]);
  }
  cout << ans << endl;
}
