#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string str;
  cin >> n >> str;
  int count = 0, count2 = 0;
  bool found = false;
  for (int i = 0; (i < n); ++i) {
    if (str[i] == '#') {
      found = true;
    }
    if (found) {
      if (str[i] == '.') {
        count++;
      } else {
        count2++;
      }
    }
  }
  cout << min(count, count2) << endl;
  return 0;
}
