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