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