As 2022 reminded the investing community, the stock market doesn't move up in a straight line. When the curtain closed, the Dow Jones Industrial Average, S&P 500, and Nasdaq Composite had respectively shed 9%, 19%, and 33% of their value. It was the worst return for all three indexes since the heart of the financial crisis in 2008.

However, short-term pain is usually a recipe for long-term gain. That's because every double-digit percentage decline in the Dow, S&P 500, and Nasdaq Composite throughout history (excluding the current bear market) has eventually been washed away by a bull market rally. It means long-term investors have the opportunity to buy stakes in innovative businesses at a discount.

A person counting through four one hundred dollar bills in their wallet.

Image source: Getty Images.

Additionally, investment constraints that existed as recently as 10 years ago are now gone. With most online brokerages eliminating commission fees and minimum deposit requirements, any amount of money -- even $400 -- can be the ideal amount to put to work right now.

If you have $400 ready to invest, and you won't need this cash to pay bills or cover emergencies, the following three stocks make for no-brainer buys right now.

Berkshire Hathaway (Class B shares)

The first surefire buy with $400 right now is Warren Buffett's company, Berkshire Hathaway (BRK.A -0.39%) (BRK.B -0.56%). I'm specifically talking about the Class B shares (BRK.B), since each Class A share will set you back more than $473,000.

While past performance is no guarantee of future results, it's safe to say that Warren Buffett and his investment team have a pretty impressive track record. Since the Oracle of Omaha became CEO in 1965, Berkshire's Class A stock (BRK.A) has doubled up the annualized total return, including dividends paid, of the S&P 500 (19.8% versus 9.9%). Put another way, Berkshire Hathaway has been doubling investors' money, on average, about every 3.6 years for more than a half-century.

One of the core reasons Berkshire Hathaway continues to excel is because Buffett and his team have packed the company's $334 billion portfolio with dividend stocks. Companies that regularly dole out a dividend are almost always profitable and time-tested. Most importantly, dividend stocks have a track record of handily outperforming stocks that don't offer a payout. Berkshire is on track to collect more than $6 billion in dividend income in 2023.

To build on this point, Berkshire Hathaway's investment portfolio is primarily composed of cyclical businesses. Warren Buffett is well aware that recessions are a normal part of the economic cycle and that trying to time when they'll occur is a fool's errand. Understanding that recessions don't last very long, he's positioned his company's portfolio and operations to benefit immensely during long-winded periods of expansion.

Berkshire Hathaway's subtly impressive capital-return program is another smart reason to buy. Even though Buffett's company doesn't pay a dividend, the Oracle of Omaha and his right-hand man, Charlie Munger, have overseen the repurchase of $66 billion of Berkshire Hathaway stock since July 2018. Share buybacks can provide a lift to earnings per share and make an already cheap stock that much more fundamentally attractive.

Fiverr International

The second no-brainer stock to buy with $400 right now is online-services marketplace Fiverr International (FVRR -1.68%). In spite of near-term concerns that a recession will materialize in the U.S., Fiverr is perfectly positioned to take advantage of a discernable shift in the labor force.

Pretty much anything having to do with the gig economy is in better shape than it was prior to the COVID-19 pandemic -- and that especially goes for Fiverr. Although some workers have returned to the office, more people than ever are choosing to work remotely. This permanent shift in the workforce is the sustained catalyst that can turn Fiverr's freelancer marketplace into a cash machine.

Fiverr offers two, clear-cut competitive advantages over its rivals. To begin with, its pricing is considerably more transparent. Whereas freelancers on most sites list their tasks at an hourly rate, Fiverr freelancers price their jobs as an all-inclusive package. This cost transparency has helped grow both spend per buyer and the aggregate number of buyers on Fiverr's platform.

To add to this point, Fiverr's growth has been especially strong among its top usage buyers. Even though the number of active buyers grew by a pedestrian 1% during the fourth quarter from the previous year, the number of buyers spending $10,000 or more annually on its marketplace jumped 29%. These high-value buyers are secret sauce that should drive sustainable, double-digit earnings growth.

The second competitive advantage offered by Fiverr is its take rate, i.e., the percentage of each deal negotiated on its platform that it keeps. Fiverr's 30.2% take rate continues to climb (up 100 basis points over the past year), and it's not chasing away its freelancers or buyers.

A lab researcher using a pipette to place liquid samples into a test tray.

Image source: Getty Images.

AstraZeneca

A third no-brainer stock you can buy right now with $400 is pharmaceutical behemoth AstraZeneca (AZN -0.39%).

One of the best aspects of healthcare stocks is that they provide a basic necessity good or service. While it would be great if we could simply choose not to get sick when it's not financially convenient, that's not how life works. Regardless of how the U.S. and global economy perform, people will need prescription drugs, medical devices, and an assortment of healthcare services. It effectively means that drugmakers like AstraZeneca can count on predictable cash flow year in and year out.

Two indications, in particular, have really been fueling AstraZeneca's success. Excluding currency movements, the company's oncology and cardiovascular segments registered 12% and 22% respective sales growth in the December-ended quarter. On a combined basis, these two segments accounted for 57% of AstraZeneca's total sales. Cancer blockbusters Tagrisso, Imfinzi, Lynparza, and Calquence, all delivered double-digit, constant-currency sales growth. Meanwhile, next-generation type 2 diabetes drug Farxiga wowed with 56% year-on-year sales growth (excluding currency movements).

Rare-disease therapies are another long-term bright spot for AstraZeneca following its July 2021 acquisition of Alexion Pharmaceuticals. Companies that are successful in developing drugs to treat ultrarare indications often face little or no competition and rarely contend with any list-price pushback from insurance companies.

This acquisition was especially smart given that Alexion had developed a next-generation therapy, known as Ultomiris, for its blockbuster drug Soliris. Gaining regulatory approvals/label expansions for Ultomiris and steadily shifting sales away from Soliris will allow Alexion's parent AstraZeneca to protect more than $5 billion in annual rare-disease revenue from generic competition once Soliris loses its sales exclusivity.