#include <bits/stdc++.h>
using namespace std;
int main() {
  size_t n;
  cin >> n;
  string s;
  cin >> s;
  size_t pos = s.find("#");
  if (pos == string::npos) {
    cout << 0 << endl;
    return 0;
  }
  size_t count = 0;
  for (size_t i = pos; i < n; i++) {
    if (s[i] == '.') {
      count++;
    }
  }
  cout << min(count, n - pos - count) << endl;
  return 0;
}
