in reply to counting protein residues

tr/// can be used to count the number of occurrences of characters in some set of characters in a string.

As this is most likely homework, I'm not saying anything more.