Mary purchased chairs for $ 38 and sold all but 20 of them for $ 64 each, making a profit of $ 358. How many chairs did she originally purchase?