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