James buys 200 lotto tickets for 2 dollars each.  Of those tickets 20% are winners.  80% of the winners are for 5 dollars. 1 ticket is the grand prize of $5,000.  The other tickets win an average of $10.  How much did he profit?
He spent 200*2=$
<gadget id="calculator">200*2</gadget>
<output>400</output>
400.
There were 200*.2=
<gadget id="calculator">200*.2</gadget>
<output>40</output>
40 tickets.
Of those 40*.8=32 are 5 dollar winners.
So they win 32*5=$
<gadget id="calculator">32*5</gadget>
<output>160</output>
160.
He has 40-32=
<gadget id="calculator">40-32</gadget>
<output>8</output>
8 other winning tickets.
Of those 8-1=
<gadget id="calculator">8-1</gadget>
<output>7</output>
7 wins $10.
So they win 10*7=$
<gadget id="calculator">10*7</gadget>
<output>70</output>
70.
So he won 5000+70+160-400=$
<gadget id="calculator">5000+70+160-400</gadget>
<output>4_830</output>
4830.

<result>4_830</result>