#include <bits/stdc++.h>
using namespace std;
int main() {
  char S[1000000 * 2 + 1] = {};
  int N, ans = 0;
  bool flag = false;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (!flag && S[i] == '#') {
      flag = true;
    }
    if (flag && S[i] == '.') {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
