Alexander has nickels, dimes, and quarters in the ratio of 2:1:8, if 40 of Alexander's coins are quarters, how many nickels and dimes does Alexander have?