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