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