Tom was collecting cans for recycling. In 5 months he collected 189 bags with 40 cans inside each bag. How many cans did he have in total?