#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  string N;
  cin >> N;
  bool answer = false;
  int count1 = 0, count2 = 0;
  for (int i = 0; i < a; i++) {
    if (N.at(i) == '.') {
      count1++;
    } else {
      break;
    }
    if (i == a) {
      answer = true;
    }
  }
  for (int i = count1; i < a; i++) {
    if (N.at(i) == '.') {
      count2++;
    }
  }
  for (int i = 0; i < a - 1; i++) {
    if (N.at(i) == '#' && N.at(i + 1) == '.') {
      break;
    }
    if (i = a - 1) answer = true;
  }
  if (answer == true) {
    cout << 0 << endl;
  } else {
    int m = a - count1 - count2;
    if (count2 <= m) {
      cout << count2 << endl;
    } else {
      cout << m << endl;
    }
  }
}
