You are playing a game in which you have $3$ envelopes, each containing a uniformly random amount of money between $0$ and $1000$ dollars. (That is, for any real $0 \leq a < b \leq 1000$, the probability that the amount of money in a given envelope is between $a$ and $b$ is $\frac{b-a}{1000}$.) At any step, you take an envelope and look at its contents. You may choose either to keep the envelope, at which point you finish, or discard it and repeat the process with one less envelope. If you play to optimize your expected winnings, your expected winnings will be $E$. What is $\lfloor E\rfloor,$ the greatest integer less than or equal to $E$?

[i]Author: Alex Zhu[/i]