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