#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  long long ans = 0, cnts = 0, cntb = 0;
  bool flag = false;
  for (int i = 0; i < n; ++i) {
    if (flag and s[i] == '.') {
      ans += 1;
      cnts += 1;
    } else if (!flag and s[i] == '#') {
      flag = true;
      cntb += 1;
    } else if (flag and s[i] == '#') {
      if (i != n - 1) {
        cntb += 1;
      }
    }
  }
  ans = min(cnts, cntb);
  cout << ans << endl;
}
