#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, res = 0;
  bool flag = false;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') flag = true;
    if (flag && S[i] == '.') res++;
  }
  cout << res << endl;
  return 0;
}
