Jacob earns $20 per hour * 10 hours = $<<20*10=200>>200 for working.
So he earns $4 each * 24 = $<<4*24=96>>96 for the cookies.
So far he has earned $200 + $96 = $<<200+96=296>>296.
He buys a lottery ticket so $296 - $10 = $<<296-10=286>>286 was left in his money.
After winning in a lottery, he had a total of $500 + $286 = $<<500+286=786>>786.
He gets $500 * 2 per sister = $<<500*2=1000>>1000 from her sisters.
So he has so far $1000 + $786 = $<<1000+786=1786>>1786.
He needs $5000 - $1786 = $<<5000-1786=3214>>3214.
#### 3214