#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  string s;
  cin >> n >> s;
  int l[n + 5], r[n + 5];
  l[0] = 0;
  for (int i = 1; i < n; ++i) {
    l[i] = l[i - 1];
    if (s.at(i - 1) == '#') {
      ++l[i];
    }
  }
  r[n] = 0;
  for (int i = n - 1; i >= 0; --i) {
    r[i] = r[i + 1];
    if (s.at(i) == '.') {
      ++r[i];
    }
  }
  int ans = 100000000;
  for (int i = 0; i < n; ++i) {
    ans = min(ans, l[i] + r[i]);
  }
  cout << ans << endl;
  return 0;
}
