#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const int mx = 100010;
const long long mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> a(n + 1, 0);
  for (int i = (int)(0); i < (int)(n); ++i) {
    a[i + 1] = a[i] + (s[i] == '#' ? 1 : 0);
  }
  int ans = inf;
  for (int i = (int)(0); i < (int)(n); ++i) {
    ans = min(ans, a[i + 1] + (n - i - (a[n] - a[i + 1])));
  }
  cout << ans << endl;
  return 0;
}
