$d$ is a positive integer not equal to $2, 5$ or $13$. How many values of $d$ are there such that for any pair $(a, b)$ from the set $\{2, 5, 13, d\}$, $ab-1$ is a perfect square?

This is IMO 1986 -1.

This problem is a part of the set "Olympiads and Contests Around the World - 2". You can see rest of the problems here.

Your answer seems reasonable.
Find out if you're right!