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