Nucleotide count in ruby