Assume we have "d" doubles and "t" triples. Then we've got 35 peanuts (because that's how many shells we've got) so

We get 2 peanuts for a double and 3 peanuts for a triple. Thus we've got

So solve the first equation for t:

And insert this value of t into the second equation:

So there were 27 in the doubles pile.

-Dan