wow... still can't follow but, if the problem involves searching a string and doing math with the pieces you may want to research/use functions below

substr() ... will allow you to pick a piece of the string.
lenght() ... will tell you the total lenght of the string.
to_number() ... will convert a char into a number