A kitten was given to a child as a birthday present when she was two years old. The cat lived a good life, but eventually became old and passed away. If the sum of the ages totaled 30, how old was the cat when it died?