#include <bits/stdc++.h>
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n;
  cin >> s;
  int b[n], w[n], sumb = 0, sumw = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      sumb++;
    } else {
      sumw++;
    }
    b[i] = sumb;
    w[i] = sumw;
  }
  int ans;
  for (int i = 0; i < n; i++) {
    int a = b[i] + (w[n - 1] - w[i]);
    ans = min(ans, a);
  }
  cout << ans << endl;
  return 0;
}
