#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int a[n];
  int count_b = 0;
  int count_w = 0;
  int flag_b = -1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      a[i] = i;
      if (flag_b == -1) {
        flag_b = i;
      }
    } else {
      a[i] = -1;
    }
  }
  for (int i = flag_b; i < n; i++) {
    if (s[i] == '#') {
      count_b++;
    } else {
      count_w++;
    }
  }
  int count = 0;
  if (s[n - 1] == '#') {
    count = 1;
  }
  if (count_b - count <= count_w) {
    cout << count_b - count << endl;
  } else {
    cout << count_w << endl;
  }
}
