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