#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string S;
  cin >> S;
  string T = S;
  int ans_b = 0;
  int ans_w = 0;
  int cnt_b = 0, cnt_w = 0;
  bool elf = false;
  for (int i = 0; i < n; ++i) {
    if (S[i] == '#') {
      if (elf) {
        ans_b += cnt_b;
        ans_w += cnt_w;
        cnt_b = 0;
        cnt_w = 0;
      }
      cnt_b++;
    } else {
      if (!elf) elf = true;
      cnt_w++;
    }
  }
  ans_b += cnt_b;
  ans_w += cnt_w;
  int ans = min(ans_b, ans_w);
  cout << (ans) << endl;
  return 0;
}
