#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int sum = 0;
  int a = 0;
  int b = 0;
  int i = 0;
  bool frag = false;
  int k = n - 1;
  while (k > 0) {
    while (s.at(k) == '#') {
      n--;
      k--;
    }
    break;
  }
  while (i < n) {
    if (s.at(i) == '#') {
      frag = true;
    }
    if (frag == true) {
      if (s.at(i) == '#') {
        a += 1;
      } else {
        b += 1;
      }
    }
    i++;
  }
  sum = min(a, b);
  cout << sum << endl;
  ;
}
