The cat received half as many fish as the number given to the dog, which means the cat received 1/2*40 = 20 fish.
This means Keanu bought 20+40 = <<20+40=60>>60 fish at the store.
If each fish cost him $4, the total cost for the fish he bought at the store is 60*$4 = $<<60*4=240>>240
#### 240