#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using veci = vector<int>;
using vecll = vector<ll>;
using vecull = vector<ull>;
int main(void) {
  ll N;
  string S;
  cin >> N >> S;
  ll w = 0, b = 0;
  ll bb = 0;
  for (int i = (0); i < (int)(N); ++i) {
    if (S[i] == '#') {
      b++;
      bb++;
    } else {
      w++;
      bb = 0;
    }
  }
  N -= bb;
  b -= bb;
  cout << min(N - b, N - w) << endl;
  return 0;
}
