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