in reply to counting protein residues

Like other monks already mentioned, you need to give more info to get proper responses.

What did you try?

Don't know what "number of residues in the helices" means, but if you want to count the H's from the string, below is one way to do it:

my $jpred='--------HHHHHH-----HHHHHHHH------'; print ( $jpred=~ tr/H/H/ ); Output: 14