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