A total of $500 was invested, part of it at 7 percent interest and the remainder at 8 percent .If the total yearly interest from both investments amounted to $38 ,how much was invested at 8 percent rate?