Bet against the masses. Don't be the lemming. Be fearful when others are greedy.

Follow these simple rules, and you'll probably be a successful investor.

With those rules of thumb in mind, you'd be forgiven for thinking that now is a terrible time to buy stocks. The S&P 500 is up more than 75% since last March, which is typically consistent with a market flooded with uncontrolled euphoria. Sure enough, many are preaching of an overvalued market that's gotten way ahead of itself.

Stand back  
Maybe they're right. Sooner or later, they probably will be. But perspective is in order: When stocks bottomed out last year, a better part of the investment community thought the world was about to explode. Companies traded for trivial valuations because, quite literally, many thought the economy was about to implode for good. 

Today, it looks like we've skirted most of those calamitous end-of-the-world threats, thank heavens. It's still bad, mind you, just not as bad as many thought. Naturally, stocks have sprung back to levels that reflect a deep recession, rather than a total Mad Max scenario.

This is an incredibly important distinction to make: Markets haven't risen to levels reflective of exuberance, but to levels consistent with a world that isn't about to fall into mass insolvency.

This is evident by looking at the biggest winners over the past months. By and large, the stocks that have risen the most are ones you wouldn't recommend to your worst enemy. Have a look:

Company

Return Since March 2009

Dollar Thrifty Automotive

4,918%

Dana Holdings

3,676%

Avis Budget Group

3,095%

Are these companies destined for greatness? Did they announce a new blockbuster product? Are they the next Google, waiting to change the way we live? Goodness, no. Not even close. Their huge gains are simply a reflection that they'll live to see another day.

In general, this is a rally built on canceling out past pessimism. The biggest gains have been concentrated in very low-quality companies that are simply being given a second shot at life.

Not all gains are created equal 
The idea that a stock is overvalued after a massive run-up is contingent on the idea that it was properly priced to being with. But this was hardly the case when the market bottomed in March. More importantly, some of the highest-quality companies in the world still trade at attractive prices.

I like three in particular: Weight Watchers (NYSE: WTW), Hewlett-Packard (NYSE: HPQ), and Paychex (Nasdaq: PAYX). Let me tell you why. 

Our nation has two distinct characteristics: We're fat, and we like someone else to make decisions for us. Enter Weight Watchers, which currently trades at just 10 times forward earnings, spits off tremendous amounts of cash year after year, and pays a 2.7% dividend.

Hewlett-Packard gets ignored because it doesn't have Apple's (Nasdaq: AAPL) pizzazz. It isn't changing the world. It doesn't have maniacal fans camping out the night before its product launches. Its CEO wouldn't look cool wearing black turtlenecks 365 days a year. What HP does have over Apple is a stock trading at 11 times next year's earnings, with a five-year projected growth rate of 13.4%. Apple, on the other hand, might have its much-deserved hype fully baked in, given its 18-times-next-year's earnings multiple, and a five-year projected growth rate of 17.7%. If you're in the market for the unloved and forgotten, HP is where you want to be.  

At last, March showed significant job growth for the first time in years, adding 162,000 jobs. You can downplay and pick that number apart all you'd like: Some say it owed to weather; others say (mostly accurately) that the 2010 Census hiring makes it misleading. So be it. Adjust however you'd like, and you still get the same answer: Job losses have turned into job creation. And when you think what sustained job creation can do to a company like payroll processor Paychex -- currently sporting a 4% dividend -- it's hard not to get excited. For a more established, although probably not as lucrative, pick, check out larger payroll processor ADP (NYSE: ADP).

Onward 
Perspective can be a powerful thing: Two years ago, Dow 11,000 would have been associated with the end of the world. Today, some want to treat it like it symbolizes irrational exuberance simply because we've bounced so far off last March's lows. This makes no sense. Focusing on a stock's percentage change over a short period of time is utterly meaningless. Drilling down on a company's intrinsic value, and buying bargains like we haven't seen in decades, is far more important.

And that's why our Motley Fool Inside Value team of analysts is having a field day digging through the rubble, finding cheap stocks like never before. To see what we're recommending today, click here for a free 30-day trial. There's no obligation to subscribe.

This article was published on June 25, 2009.  It has been updated.

Paychex and Weight Watchers International are Motley Fool Inside Value picks. Google is a Motley Fool Rule Breakers choice. Apple is a Motley Fool Stock Advisor selection. Paychex is a Motley Fool Income Investor selection. Motley Fool Options has recommended a diagonal call position on Microsoft.

Fool contributor Morgan Housel doesn't own shares in any of the companies mentioned in this article. The Fool has a disclosure policy.