#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 200000;
long long N, ans = 10000000000, tmp = 0;
vector<long long> A, B;
string S;
signed main() {
  cin >> N >> S;
  A.resize(N + 1);
  B.resize(N + 1);
  A[0] = 0;
  B[N] = 0;
  for (long long i = 1; i <= N; i++) {
    if (S[i] == '#')
      A[i] = A[i - 1] + 1;
    else
      A[i] = A[i - 1];
  }
  for (long long i = N; i >= 0; i--) {
    if (S[i] == '.')
      B[i] = B[i + 1] + 1;
    else
      B[i] = B[i + 1];
  }
  for (long long i = 0; i <= N; i++) {
    ans = min(ans, A[i] + B[i]);
  }
  cout << ans << endl;
  return 0;
}
