#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, first_right_white_stone;
  int number_of_black_stone = 0;
  int number_of_white_stone = 0;
  int swap_min = 0;
  string S;
  cin >> N >> S;
  reverse(S.begin(), S.end());
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      first_right_white_stone = i;
      i = N;
    }
  }
  for (int j = first_right_white_stone; j < N; j++) {
    if (S[j] == '#') number_of_black_stone++;
  }
  for (int k = 0; k < N; k++) {
    if (S[k] == '.') number_of_white_stone++;
  }
  swap_min = min(number_of_black_stone, number_of_white_stone);
  cout << swap_min << endl;
}
