There are 23 tennis balls in total, and 3 of them are loose. Therefore, there are 23 - 3 = 20 tennis balls in cans.
Since there are 5 tennis balls in each can, the number of cans of tennis balls can be calculated by dividing the total number of tennis balls in cans by the number of balls per can:
20 tennis balls / 5 balls per can = 4 cans of tennis balls.
Therefore, there are 4 cans of tennis balls in the bag.