# Ansh Moraje
# Bergen County Academies
# Intermediate Division


def main():
    inputFile = open("2int_sampledata.txt", "r")
    for line in inputFile:
        input = line.strip().split(" ")
        string1 = input[0]
        string2 = input[1]
        done = False
        answer = 0
        rangeNum = len(string1)
        if(len(string2) < len(string1)):
            rangeNum = len(string2)

        while(not done):
            rangeNum = len(string1)
            if (len(string2) < len(string1)):
                rangeNum = len(string2)

            if(rangeNum == 0):
                break

            for i in range(rangeNum):
                if string1[i] == string2[i]:
                    string1 = string1[:i] + string1[i+1:]
                    string2 = string2[:i] + string2[i+1:]
                    break


                if i == rangeNum-1:

                    for j in range(rangeNum):
                        if j != len(string2)-1:
                            if string1[j] == string2[j+1]:
                                string2 = string2[:j] + string2[j+1:]
                                break

                        if j != len(string1)-1:

                            if string1[j+1] == string2[j]:
                                string1 = string1[:j] + string1[j+1:]
                                break


                        if(j == rangeNum-1):
                            done = True


        if (len(string2) < len(string1)):
            rangeNum = len(string2)
            answer += len(string1) - len(string2)
            string1 = string1[:rangeNum]

        if(len(string1) < len(string2)):
            rangeNum = len(string1)
            answer += len(string2) - len(string1)
            string2 = string2[:rangeNum]

        for i in range(rangeNum):
            answer += (ord(string1[i]) - ord(string2[i]))

        print(answer)


main()