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