document count script