#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int a, b = 200000, c = 0, d = 0;
  string str;
  cin >> a;
  cin >> str;
  for (int i = 0; i < a; i++) {
    if (str[i] == '#') {
      b = i;
      break;
    }
  }
  if (b != 200000) {
    for (int i = b; i < a; i++) {
      if (str[i] == '.')
        c++;
      else
        d++;
    }
  } else {
    c = 0;
  }
  cout << min(d, c) << endl;
  return 0;
}
