#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 15;
const long long MOD = 1e9 + 7;
const double EPS = 1e-9;
int main(int argc, const char* argv[]) {
  int N;
  string S;
  cin >> N >> S;
  bool flag = false;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') flag = true;
    if (flag) {
      if (S[i] == '.') ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
