def commonCount (stringA, stringB):
    listB = list(stringB)
    count = 0
    for charA in stringA:
        # nested loop
        for charB in listB:
            if charA == charB:
                count = count + 1
                listB.remove(charA)
                break  # end inner loop, go to next iteration of outer loop
    return count
