Let Ram's share be 'x'
$\therefore$ Sham's share = 5887 - x
By the given condition,
x$\left ( 1 + \frac{5}{100} \right )^{11}$ = (5887 - x)$\left ( 1 + \frac{5}{100} \right )^{9}$
$\Rightarrow$ (1+ (1.05)2)x = 5887
$\Rightarrow$ x = 2800
$\therefore$ Sham's share = 5887 - 2800 = 3087