#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool isS = false;
  int r1 = 0, r2 = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '#') {
      r1++;
      isS = true;
    } else if (isS)
      r2++;
  }
  cout << min(r1, r2) << endl;
}
