#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string S;
  cin >> N >> S;
  long long num_b = 0, num_w = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#')
      num_b++;
    else
      num_w++;
  }
  long long first_black = N;
  for (long long i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      first_black = i;
      break;
    }
  }
  reverse(S.begin(), S.end());
  long long last_white;
  for (long long i = 0; i < N; i++) {
    if (S.at(i) == '.') {
      last_white = i;
      break;
    }
  }
  if (num_b > num_w)
    cout << num_w - first_black << endl;
  else {
    if (first_black == N) {
      cout << 0 << endl;
      return 0;
    } else
      cout << num_b - last_white << endl;
  }
}
