counting dna nucleotide algorithm