#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long i, j;
long long temp;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  string a;
  cin >> a;
  long long arr1[n];
  long long arr2[n];
  arr1[0] = 0;
  for (i = 1; i < n; i++) {
    if (a[i - 1] == '#') {
      arr1[i] = arr1[i - 1] + 1;
    } else
      arr1[i] = arr1[i - 1];
  }
  arr2[n - 1] = 0;
  for (i = n - 2; i >= 0; i--) {
    if (a[i + 1] == '.') {
      arr2[i] = arr2[i + 1] + 1;
    } else
      arr2[i] = arr2[i + 1];
  }
  long long min = 99999999999;
  for (i = 0; i < n; i++) {
    if (arr1[i] + arr2[i] < min && a[i] == '#') min = arr1[i] + arr2[i];
  }
  if (min > 9999999999)
    cout << 0;
  else
    cout << min;
  return 0;
}
