Originally Posted by

**Soroban** Hello, harish21!

Let $\displaystyle N$ = total number of fish.

The 1st discards one fish and take a third of the remainder.

Then $\displaystyle N$ must be of the form: .$\displaystyle 3A + 1$

. . $\displaystyle N \:=\:3A + 1$ .[1]

He discards one fish . . . $\displaystyle 3A$ fish left.

He take a third of the fish ($\displaystyle A$ fish) and leaves.

There are $\displaystyle 2A$ fish left.

The 2nd discards one fish and takes a third of the remainder.

Then $\displaystyle 2A$ must be of the form $\displaystyle 3B + 1$

. . $\displaystyle 2A \:=\:3B+1$ .[2]

He discards one fish . . . $\displaystyle 3B$ fish left.

He take third of the fish ($\displaystyle B$ fish) and leaves.

There are $\displaystyle 2B$ fish left.

The 3rd discards one fish and takes a third of the remainder.

Then $\displaystyle 2B$ must be of the form $\displaystyle 3C + 1$

. . $\displaystyle 2B \:=\:3C + 1 \quad\Rightarrow\quad B \:=\:\frac{3C+1}{2}$ .[3]

Substitute [3] into [2]: .$\displaystyle 2A \;=\;3\left(\frac{3C+1}{2}\right) + 1 \quad\Rightarrow\quad A \:=\:\frac{9C+5}{4}$ .[4]

Substitute [4] into [1]: .$\displaystyle N \;=\;3\left(\frac{9C+15}{4}\right) + 1 \;=\;\frac{27C + 19}{4}$

We have: .$\displaystyle N \;=\;\frac{24C + 16 + 3C + 3}{4} \;=\;\frac{24C+16}{4} + \frac{3C+3}{4}$

Hence: .$\displaystyle N \;=\;6C+4 + \frac{3(C+1)}{4}$

Since $\displaystyle N$ is an integer, $\displaystyle C+1$ must be divisible by 4.

The first time this happens is when $\displaystyle C = 3.$

Therefore: .$\displaystyle N \;=\;6(3) + 4 + \frac{3(3+1)}{4} \quad\Rightarrow\quad \boxed{N \:=\:25}$