#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int cnt = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      for (int j = N - i + 1; j > i; j--) {
        if (S[j] == '.') {
          cnt++;
        }
      }
      goto OUT;
    }
  }
OUT:
  cout << cnt << endl;
  return 0;
}
