#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') count++;
  }
  if (count == N || count == 0)
    cout << 0 << endl;
  else if (count == 1)
    cout << 1 << endl;
  else {
    int black_L = 0, black_R = 0;
    for (int i = 0; i < N; i++) {
      if (S.at(i) == '#') {
        black_L = i;
        break;
      }
    }
    for (int i = N - 1; i >= 0; i--) {
      if (S.at(i) == '#') {
        black_R = i;
        break;
      }
    }
    int count_black = 0, count_white = 0;
    for (int i = black_L; i <= N - black_R; i++) {
      if (S.at(i) == '#')
        count_black++;
      else
        count_white++;
    }
    if (count_black >= count_white)
      cout << count_white << endl;
    else
      cout << count_black << endl;
  }
}
