#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  vector<long long> B(N), W(N + 1);
  if (S[0] == '#') B[0] = 1;
  if (S[N - 1] == '.') W[N - 1] = 1;
  for (int i = 1; i < N; i++) {
    B[i] = B[i - 1];
    if (S[i] == '#') B[i]++;
  }
  for (int i = N - 2; i >= 0; i--) {
    W[i] = W[i + 1];
    if (S[i] == '.') W[i]++;
  }
  long long ans = 1000000000;
  for (int i = N - 1; i >= 0; i--) {
    long long tmp = 1000000000;
    tmp = B[i] + W[i + 1];
    ans = min(ans, tmp);
  }
  cout << ans << endl;
}
