Wash sale

Sold 500 shares of XYZ Corp. stock at $20 per share. Green purchased these shares two years prior at $22 per share. Three weeks subsequent to the sale, Green purchased 100 shares of XYZ Corp. stock at $18 per share. why the answer is 800 loss? I thought it is a wash sale