#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K, i, n, m;
  string S;
  vector<pair<int, int>> zero, one;
  cin >> N >> S;
  int A = 0, B = 0, C = 0, D = 0;
  for (i = 0; i < (N); ++i) {
    if (S[i] == '.')
      B++;
    else
      C++;
  }
  m = 0;
  for (i = 0; i < (N); ++i) {
    if (S[i] == '.') n = i;
    if (m == 0 && S[i] == '#') m = i;
  }
  for (i = 0; i < (n); ++i) {
    if (S[i] == '#') A++;
  }
  for (int i = m; i < N; i++) {
    if (S[i] == '.') D++;
  }
  cout << min(D, min(A, min(B, C))) << endl;
  return 0;
}
