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