#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  string S;
  cin >> N >> S;
  vector<long long> A(N, 0), B(N, 0);
  long long suma = 0, sumb = 0;
  for (long long i = 0; i < N; i++) {
    if (i == 0) {
      if (S[i] == '#') {
        A[i] = 1;
        suma++;
      }
    } else if (S[i] == '#') {
      A[i] = A[i - 1] + 1;
      suma++;
    } else {
      A[i] = A[i - 1];
    }
  }
  for (long long i = N - 1; i >= 0; i--) {
    if (i == N - 1) {
      if (S[i] == '.') {
        B[i] = 1;
        sumb++;
      }
    } else if (S[i] == '.') {
      B[i] = B[i + 1] + 1;
      sumb++;
    } else {
      B[i] = B[i + 1];
    }
  }
  long long ans = 9223372036854775807;
  for (long long i = 0; i < N; i++) {
    ans = min(ans, A[i] + B[i]);
  }
  ans = min(ans, suma);
  ans = min(ans, sumb);
  cout << ans << endl;
  return 0;
}
