#include <bits/stdc++.h>
using namespace std;
int main() {
  bool flag = true;
  long long ans = 0, sum = 0, mn = ((1 << 30) - 1);
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      ans += 1;
    } else {
      sum += 1;
      ans -= 1;
    }
    mn = min(mn, ans);
  }
  ans = mn + sum;
  cout << ans << endl;
  return 0;
}
