#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int ans = 0;
  int ed = 0;
  while (ed < N - 1) {
    if (S[ed] == '#') {
      break;
    }
    ed++;
  }
  for (int i = N - 1; i >= ed; i--) {
    if (S[i] == '.') {
      ans++;
    }
  }
  if (ans == N) {
    ans = 0;
  }
  cout << ans << '\n';
  return 0;
}
