#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long N, ans = 0;
  string S;
  cin >> N;
  cin >> S;
  vector<long long> siro(N + 1, 0), kuro(N + 1, 0);
  if (S[0] == '#')
    kuro[0]++;
  else
    siro[0]++;
  for (int(i) = (1); (i) < (N); (i)++) {
    if (S[i] == '#') {
      kuro[i] = kuro[i - 1] + 1;
      siro[i] = siro[i - 1];
    } else {
      siro[i] = siro[i - 1] + 1;
      kuro[i] = kuro[i - 1];
    }
  }
  ans = min(siro[N - 1], kuro[N - 1]);
  long long tmp = 0;
  for (int(i) = (1); (i) < (N - 1); (i)++) {
    tmp = 0;
    tmp += kuro[i - 1];
    tmp += siro[N - 1] - siro[i - 1];
    ans = min(ans, tmp);
  }
  cout << ans;
  return 0;
}
