#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<bool> check(2, false);
  vector<int> ans(4, 0);
  for (int i = 0, i_len = (n); i < i_len; i++) {
    if (s[i] == '#') {
      ans[0]++;
      check[0] = true;
    } else {
      ans[1]++;
      if (check[0]) ans[3]++;
    }
  }
  for (int i = (n)-1; i >= 0; i--) {
    if (s[i] == '.') {
      check[1] = true;
    } else {
      if (check[1]) ans[2]++;
    }
  }
  cout << min(ans[0], min(ans[1], min(ans[2], ans[3]))) << endl;
  return 0;
}
