#include <bits/stdc++.h>
using namespace std;
template <class T>
T* serchL(T* begin, T* end, T num) {
  T* p = begin;
  for (; p < end; p++) {
    if (&p >= num) {
      return p;
    }
  }
  return NULL;
}
int main() {
  ios::sync_with_stdio(false);
  string S;
  int N;
  cin >> N >> S;
  int ans = 0;
  int i = N - 1;
  for (i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      break;
    }
  }
  for (int j = N - 1; j >= i; j--) {
    if (S.at(j) == '.') {
      ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
