Answer: 27x+10
Explanation:
Let both the boys are putting 'x' index cards in each envelope.
then, The number of index cards Marty put=

And The number of index cards Stewart put=

Now, the total number of index cards they have started with =

Hence, the total number of index cards they have started with =27x+10