#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  char S[N];
  cin >> S;
  int white, black;
  white = black = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      white++;
    }
  }
  int answer = white;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#') {
      black++;
    } else {
      white--;
    }
    answer = min(answer, white + black);
  }
  cout << answer << endl;
}
