#include <bits/stdc++.h>
using namespace std;
int main() {
  long N, count = 0;
  long index;
  string str;
  cin >> N >> str;
  index = N;
  for (long i = 0; i < N; i++) {
    if (str[i] == '#') {
      index = i;
      break;
    }
  }
  for (long i = index + 1; i < N; i++) {
    if (str[i] == '.') {
      count++;
    }
  }
  if (index + 1 < count) {
    cout << count;
  } else {
    cout << index + 1 << endl;
  }
  return 0;
}
