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