#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int i, j;
  int cou[N + 1];
  for (i = 0; i <= N; ++i) {
    cou[i] = 0;
    for (j = 0; j < i; ++j) {
      if (S[j] != '.') {
        cou[i] += 1;
      }
    }
    for (j = i; j < N; ++j) {
      if (S[j] != '#') {
        cou[i] += 1;
      }
    }
  }
  int mc = cou[0];
  for (i = 0; i < N; ++i) {
    if (mc > cou[i + 1]) {
      mc = cou[i + 1];
    }
  }
  cout << mc << endl;
}
