Transporting cargo by boat doesn’t usually require solving tricky brainteasers. That’s not the case with this fishy riddle from TED-Ed.

For this scenario, imagine you're a cargo boat director who’s charged with shipping several tanks of rare fish to an aquarium. The tanks are tossed overboard during a rough storm and it’s your job to retrieve them. There’s a mini-sub onboard that might be of assistance, but there’s a problem: You only have enough fuel for it to make one quick trip. Before launching your rescue mission, you need to figure out exactly how many tanks fell into the water and where they landed.

After referring to sonar data, thermal imaging, and your shipping notes, you come up with this list of information to help narrow down your search.

1. There are three sectors where the cargo landed.

2. There are 50 animals in the area, including the lost fish and deadly sharks.

3. Each sector contains between one and seven sharks and no two sectors have the same amount of sharks.

4. The tanks each have the same amount of fish.

5. There are 13 tanks at most.

6. The first sector has two sharks and four tanks in it.

7. The second sector has four sharks and two tanks.

So how many fish are there? If you came up with 39, you’re right. There can only be 39 fish spread out across 13 tanks, which means there are three fish in each.

In case you’re feeling more confused now than you were before, you can refer to TED-Ed’s full explanation in the video below.