#include <bits/stdc++.h>
using namespace std;
int N;
int main(void) {
  cin >> N;
  char S[N];
  cin >> S;
  int first = 0;
  bool flag = false;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      first = i;
      flag = true;
      break;
    }
  }
  if (!flag) {
    cout << 0 << endl;
    return 0;
  }
  int ans0 = 0;
  int ans1 = 0;
  int cnt0 = 0;
  int cnt1 = 0;
  for (int i = first; i < N; i++) {
    if (S[i] == '#') {
      ans0 += cnt0;
      cnt0 = 0;
      cnt1++;
    } else {
      ans1 += cnt1;
      cnt1 = 0;
      cnt0++;
    }
  }
  if (cnt0 > 0) {
    ans0 += cnt0;
  }
  cout << min(ans0, ans1) << endl;
}
