#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  string st;
  cin >> n >> st;
  bool find = false;
  int res1 = 0, res2 = 0;
  for (int i = 0; i < n; i++) {
    if (find) {
      if (st[i] == '.')
        res1++;
      else
        res2++;
    } else {
      if (st[i] == '#') find = true;
      res2++;
    }
  }
  cout << min(res1, res2) << endl;
}
