#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int a = 0, b = 0;
  bool flg = false;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      flg = true;
    }
    if (flg && s[i] == '.') b++;
    if (flg && s[i] == '#' && i != n - 1) a++;
  }
  cout << min(a, b) << endl;
}
