Calculate number of unique identifier, fixes #20