#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000000 + 7;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  char black = '#';
  char white = '.';
  int bs = 0;
  int ws = 0;
  int bnum[200001];
  if (s[0] == black) {
    bs++;
    bnum[0] = 1;
  } else {
    ws++;
    bnum[0] = 0;
  }
  for (int i = 1; i < n; i++) {
    if (s[i] == black) {
      bs++;
      bnum[i] = bnum[i - 1] + 1;
    } else {
      ws++;
      bnum[i] = bnum[i - 1];
    }
  }
  long long ans = 99999;
  for (int i = 0; i < n; i++) {
    ans = min(ans, (long long)bnum[i] + ws - i - 1 + bnum[i]);
  }
  cout << ans << endl;
  return 0;
}
