#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = -1, a = 0, b = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      x = i;
      break;
    }
  }
  if (x == -1) {
    puts("0");
  } else {
    for (int i = x; i < n; i++) {
      if (s[i] == '.')
        a++;
      else
        b++;
    }
    cout << min(a, b) << endl;
  }
  return 0;
}
