calculate the final similarity percentage