Considering that the stock market just had its worst beginning to the year of the past 50 years, it may seem counterintuitive to be thinking about buying stocks right now. But rough market patches are actually a great time to be looking to buy shares of amazing companies that could turn out to be fantastic investments over long time horizons, like the next 20 years.

While $5,000 is a substantial sum, if you've got that much on hand for investing right now -- meaning you don't need it to pay for daily bills or for anything else in the next five years or more -- dividing it equally between Amazon (AMZN -1.14%), Roku (ROKU 1.91%), and Airbnb (ABNB 1.09%) could be a good way to use it. With each stock trading around $100 per share, you could end up with roughly 16 shares of each. 

Person sitting at a desk and looking at a computer.

Image source: Getty Images.

1. Amazon

Amazon hasn't been immune to current problems with supply chains and rising costs. Some investors dumped the stock after the company recently reported its first quarterly loss since 2015. But I think there are reasons to be a buyer of Amazon stock right now. The tech titan remains a leader in e-commerce and cloud computing -- two markets that are only getting larger. 

E-commerce makes up the lion's share of Amazon's sales, and yet the market is still very young. E-commerce sales in the U.S. account for just 14% of total retail sales. That leaves plenty of room for Amazon's business to gain more traction.

Amazon has done a fantastic job of locking people into its e-commerce ecosystem using its Prime membership. As of March 2021 (the latest data from Amazon), there were more than 200 million Prime members worldwide. And with the company continually adding new value to Prime, there's more reason than ever for members to stick around and keep paying the fee.

As important as e-commerce is to driving Amazon's sales, however, it's the cloud computing business, Amazon Web Services (AWS), where the real money is made. AWS brought in $6.5 billion in operating income in the most recent quarter, up 58% year over year. 

What's great about AWS is that it holds 33% of the cloud infrastructure market and has stayed ahead of its competitors for years as cloud infrastructure spending continues to grow.

And as companies keep investing more in their cloud infrastructure, you can bet that Amazon will continue to benefit from this lucrative market. 

Amazon trades at about $115 per share. Putting one-third of $5,000 into this stock at that price would get you about 15 shares.

2. Roku 

Roku quickly became a pandemic play during 2020, when binge-watching TV suddenly became everyone's hobby. But investors' initial enthusiasm has faded amid a huge tech sell-off. As a result, Roku stock is down a staggering 79% over the past 12 months. 

But that drop has opened up an opportunity for investors who have a much longer investing time frame than those that are focusing on the next few months.

Consider that 85% of U.S. households already have at least one streaming service right now, and they're increasingly signing up for new services through over-the-top (OTT) aggregators like Roku. Roku makes money from its users when they sign up for a new service, whether it's Disney+, Hulu, Netflix, or another service.

The streaming platform allows users to stream nearly any service, and it's already persuaded 61.3 million folks to use its platform. 

But Roku's opportunity doesn't end there. The company is selling a growing amount of ads on its platform as well. In the first quarter, the top 10 broadcast TV advertisers increased their ad spending with Roku by 80% from the year-ago period. The company is tapping into the fast-growing ad streaming market, which is expected to reach $49 billion this year, more than double its size just two years ago. 

The combination of its platform sales and its ad business helped Roku's revenue climb 28% in the most recent quarter and pushed average revenue per user (ARPU) up 34% year over year to $42.91.  

There's no guarantee of future growth, of course, but over the next few years, more people are expected to ditch cable and satellite services for streaming. And as they do, many of them will likely use Roku's platform, which is already No. 1 in the U.S., Canada, and Mexico. 

Roku stock is selling for about $94 per share. Putting one-third of $5,000 into this stock at that price would get you about 18 shares.

3. Airbnb

Airbnb's stock has taken it on the chin over the past year, falling about 37%. Given that huge drop, you might assume that the company was still reeling from the effects of pandemic restrictions. But many of Airbnb's most important metrics have bounced back recently

Consider that the company's 2022 Q1 sales of $1.5 billion were up 80% compared to the comparable quarter in 2019, soaring past pre-pandemic levels. And the number of gross nights booked is also on the rebound, jumping 32% over that same period. 

The company's nights and experiences booked metric also outpaced pre-COVID-19 figures, surpassing 100 million for the first time ever. 

In a nutshell, Airbnb's latest quarterly results show that the travel rebound that management predicted last year has come about, and travelers are booking longer stays than before and are once again venturing to big cities and across country borders. 

But despite this growth, investors have shunned the stock. Shares currently trade at a significant discount compared to their IPO price in December 2020. 

This drop has more to do with negative investor sentiment for the broader stock market than a reaction to the company's performance, though. And when the market eventually bounces back -- and history tells us that it always does -- Airbnb's unique booking platform and its stellar growth could make for a great long-term investment.

Airbnb stock is trading for about $95 per share. Putting one-third of $5,000 into this stock at that price would get you about 17 shares.