#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, u, sum[200010];
  vector<int> t(n);
  string s;
  bool can = false, can1 = false;
  cin >> n >> s;
  sum[0] = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      sum[i + 1] = sum[i] + 1;
    } else
      sum[i + 1] = sum[i];
  }
  long long ans = 1e9 + 7;
  bool flag = false;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '#') {
      flag = true;
      ans = min(ans, sum[i] + (n - i - 1) - (sum[n] - sum[i + 1]));
    }
  }
  if (!flag) ans = 0;
  cout << ans << endl;
  return 0;
}
