All the money they put in R&D is not wasted. They generate future income. However, due to accounting rules on R&D, they can't capitalized and then write off over time. If you don't understand what I am talking about, then take some accounting courses.
I am 100% in AMZN as you might know and I am still so.