#include <bits/stdc++.h>
using namespace std;
bool prime(long long n) {
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return n != 1;
}
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
signed main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long st = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '#') {
      break;
    }
    st++;
  }
  long long en = n - 1;
  for (long long i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      break;
    }
    en--;
  }
  long long b = 0, w = 0;
  for (long long i = st; i <= en; i++) {
    if (s[i] == '#') {
      b++;
    } else
      w++;
  }
  cout << min(b, w) << endl;
  return 0;
}
