#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N;
  string S;
  cin >> N;
  cin >> S;
  long long sum = 0;
  char hidari = '.';
  long long flag = 0;
  long long flag2 = 0;
  long long index = 0;
  long long index2 = N - 1;
  while (1) {
    if (index >= N - 1) {
      cout << 0 << endl;
      return 0;
    }
    if (S[index] == '#') {
      break;
    }
    index++;
  }
  while (1) {
    if (index2 <= 0) {
      cout << 0 << endl;
      return 0;
    }
    if (S[index2] == '.') {
      break;
    }
    index2--;
  }
  long long count1 = 0;
  long long count2 = 0;
  for (long long i = index; i <= index2; i++) {
    if (S[i] == '.') {
      count1++;
    } else {
      count2++;
    }
  }
  cout << min(count1, count2) << endl;
  return 0;
}
