#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long bdp[n + 10], wdp[n + 10];
  wdp[0] = 0;
  bdp[0] = 0;
  if (s[0] == '#')
    bdp[0]++;
  else
    wdp[0]++;
  for (long long i = 1; i < n; i++) {
    if (s[i] == '#') {
      bdp[i] = bdp[i - 1] + 1;
      wdp[i] = wdp[i - 1];
    } else {
      bdp[i] = bdp[i - 1];
      wdp[i] = wdp[i - 1] + 1;
    }
  }
  long long ans = MOD;
  long long num = wdp[n - 1];
  for (long long i = 0; i < n; i++) {
    long long x = bdp[i], y = num - wdp[i];
    ans = min(ans, x + y);
  }
  cout << ans << endl;
}
