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