#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N;
  cin >> N;
  string s;
  cin >> s;
  vector<long long> cntb(N + 1, 0);
  vector<long long> cntw(N + 1, 0);
  for (long long(i) = 0; (i) < (N); ++i) {
    if (s[i] == '#') cntb[i + 1] = 1;
    if (s[i] == '.') cntw[i + 1] = 1;
  }
  for (long long(i) = 0; (i) < (N); ++i) cntb[i + 1] += cntb[i];
  for (long long(i) = 0; (i) < (N); ++i) cntw[i + 1] += cntw[i];
  long long res = min(cntb[N], N - cntb[N]);
  for (long long(i) = 0; (i) < (N - 1); ++i) {
    long long l, r;
    l = cntw[i];
    r = cntb[N] - cntb[i - 1];
    res = min(res, l + r);
  }
  cout << res << endl;
  return 0;
}
