document to integer counting