#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string S;
  cin >> N >> S;
  long long inipos1 = S.find("#");
  long long inipos2 = S.rfind(".");
  if (inipos1 == -1 || inipos2 == -1) {
    cout << 0 << endl;
  } else {
    long long cnt1 = 0;
    long long cnt2 = 0;
    for (long long i = inipos1; i < N; i++) {
      if (S[i] == '.') cnt1++;
    }
    for (long long i = inipos2; i >= 0; i--) {
      if (S[i] == '#') cnt2++;
    }
    long long ans = min(cnt1, cnt2);
    for (long long i = N / 2; i < N; i++) {
      long long t1 = 0;
      long long t2 = 0;
      for (long long j = 0; j < i; j++) {
        if (S[j] == '#') t1++;
      }
      for (long long j = i; j < N; j++) {
        if (S[j] == '.') t2++;
      }
      long long t = t1 + t2;
      ans = min(ans, t);
    }
    cout << ans << endl;
  }
  return 0;
}
