#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  string s;
  cin >> n >> s;
  long long sum1 = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '.') {
      sum1++;
    } else {
      break;
    }
  }
  long long sum2 = 0;
  for (long long i = n - 1; i >= 0; i--) {
    if (s[i] == '#') {
      sum2++;
    } else {
      break;
    }
  }
  long long sum3 = 0;
  long long sum4 = 0;
  for (long long i = sum1; i < n - sum2; i++) {
    if (s[i] == '.') {
      sum3++;
    }
    if (s[i] == '#') {
      sum4++;
    }
  }
  cout << min(sum3, sum4) << endl;
}
