On my first New Year's Eve in Madrid a few years ago, we went out around 10 p.m., and found the streets deserted. The bars were closed.

It threw me for a loop: Weren't Madrileños supposed to be notorious party animals? Where were they all?

It turns out, I just went out way too early.

Spaniards often spend Nochevieja — literally, the 'old night' — at home. They watch the countdown to the new year on live TV, surrounded by family. And only then do they kiss grandma goodnight and go out partying.

"Until five in the morning, more or less! Normally until the sun rises," explains Candelas Ortiz, a traditional Madrid bartender, in a starched white shirt and black bow tie. "And then you do hot chocolate and churros, as it starts to get light out."

He's referring to the fried dough crullers Madrileños like to dip into rich syrupy hot chocolate, at all-night cafés.

For the past 17 years, Ortiz has tended the bar at Madrid's swanky Palace Hotel (now part of the Westin hotel chain), which was founded in 1912. At the time, it was Europe's largest hotel — and the first in Spain to have bathrooms and telephones in every room, says hotel spokeswoman Paloma Garcia.

"This was the place where artists, writers and painters used to have drinks," Garcia says. "Hemingway, of course, was one of them."

The hotel bar was Ernest Hemingway's old haunt, in the 1920s and '30s. This is where the characters in his 1926 novel, 'The Sun Also Rises,' go for a drink.

I sidle up to the bar one evening, and instead of ordering a typical Hemingway martini, I ask for something typical for New Year's Eve here: cava, a sparkling Spanish white wine similar to champagne.

"On New Year's Eve, we drink cava — but only at the end," Garcia explains.

Because in Spain, it's not what you drink at midnight on New Year's Eve that matters most, but what you eat: a dozen green grapes, representing good luck for each month of the coming year. And they must be eaten right at the stroke of midnight.

If you're lucky, you can find seedless grapes. That makes them slightly easier to wolf down with each chime of the bells atop a clock tower in Madrid's central Puerta del Sol square — the Spanish equivalent of Times Square. (Some people surgically de-seed the grapes beforehand with knives or toothpicks. Others claim that's cheating, and manage to skilfully perform the same extraction inside their mouths.)

The countdown goes fast. So at the exact moment when revelers across Europe are cheering and yelling out the countdown to midnight, Spaniards are silently swallowing grapes. It's said to be bad luck if you can't down them all.

"It's quite difficult! You have to select small grapes, and eat quickly," Garcia says. "My son, he's very young, and at the end he [always] has a mouth full of grapes — it's impossible!"

While many Spaniards swallow the grapes in the privacy of their own homes, the Palace Hotel throws one of the largest and fanciest New Year's Eve parties in the city. It orders hundreds of kilos of grapes for the occasion.

"They deliver them in big crates, and we have to dole them out into cups — 12 each," says the bartender Ortiz. He often does a dry-run demonstration, a few minutes before midnight, for any foreigners celebrating New Year at the hotel, who might not be familiar with this Spanish tradition.

Legend has it that Spanish wine-makers are behind the cotillón, or grape-eating, to boost demand for grapes in winter. In the last week of December, Spanish supermarkets stock huge bins of green grapes.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.