#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 1e6, tmp = 0;
  string s;
  cin >> n >> s;
  vector<int> r(n);
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') r[i]++;
    if (i == 0) continue;
    r[i] += r[i - 1];
  }
  reverse(r.begin(), r.end());
  reverse(s.begin(), s.end());
  for (int i = 0; i < n - 1; ++i) {
    if ((s[i] == '.') && (s[i + 1] == '#')) {
      ans = min(ans, tmp + r[i]);
      ++tmp;
    }
  }
  if (ans == 1e6) ans = 0;
  cout << ans << endl;
  return 0;
}
