First of all sorry for the hazy title and if my question isn't understood .English is my third language and is kinda hard to formulate the question clearly . Here's my problem I want to introduce a chemical substance formula like H3PO4 and the the program should separate H and to give him a variable name like x(and we will have 3x because its H3) and PO4 to be another variable like y. Or a simpler substance like HCl and the program should separate it in H and Cl .