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