#include <bits/stdc++.h>
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n;
  cin >> s;
  vector<int> b(n + 1, 0), w(n + 1, 0);
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      b[i + 1] = b[i] + 1;
      w[i + 1] = w[i];
    } else {
      b[i + 1] = b[i];
      w[i + 1] = w[i] + 1;
    }
  }
  int ans = 1e9 + 7;
  for (int i = 0; i < n; i++) {
    int a = b[i + 1] + (w[n] - w[i + 1]);
    ans = min(ans, a);
  }
  cout << ans << endl;
  return 0;
}
