There were the perennial candidates, including an admitted "bum," who files for almost every Maryland election. There were the political unknowns who plunked down $100 to get on the ballot in the hope of landing in Congress. wTo complete the picture, the favorites and frontrunners appeared at the state election board in Annapolis to make good on earlier declarations of candidacy.

So it went for the last two weeks at the election board as a steady stream of politicians, dreamers and also-rans signed up for what has become the most crowded Maryland race in recent years, the special election to fill Gladys Spellman's Congressional seat.

When the filing books for the Prince George's County race finally closed last night, the candidates totalled 32, a number that made state and county officials wonder whether they will have to print an unusually long sample ballot.

"Everybody and his brother has been coming in here," said state election board director Willard Morris. "Everybody who's ever run for anything must be running for this one."

Said one harried campaign aide, "The field is so crowded that when people have told me they were going to hve candidates nights I said, 'Great, I hope you bring lots of cots because it'll take seven hours to hear all those people."

Nineteen Democrats and 12 Republicans filed for the race, men and women who feel they have a shot at winning the special Democratic or Republican primaries on April 7 and then possibly the May 19 general election. There is one independent in the race who will run only in the general election, as a write-in candidate.

The candidates included 12 persons who live outside the 5th Congressional District and 10 who live outside Prince George's County, including one Republican, John Lillard, who according to his campaign manager, only lives in Maryland on weekends. There are two self-proclaimed paupers from Baltimore, one of whom, Democrat Melvin Perkins, lives out of a shopping bag and ran for U.S. Senate in 1974 on the slogan, "Throw the crooks out and put the intelligent bums in."

There is a son and a spouse of two famous county politicians, one mayor, one county council member, two state delegates, two state senators and one unsuccessful lieutenant governor candidate. "I think probably you could describe it as a cavalry charge," said one of the candidates, Democratic State Sen. Edward Conroy.

All of this is for god reason, for here is a race that in political parlance is known as "a free ride" -- no one is forced to give up a seat to run, the race is quick and, because of the limited time-span, relatively cheap at $50,000 tops for the primary.

"You have a whole lot of candidates who are doing a lot of things other than running for office," said one campaign manager. "They're running to increase their name recognition or to see how they would do in the future."

Among the candidates there are fewer than 10 who at this time are considered serious contenders.

Despite the long list of Republicans, that primary is considered likely to be a head-to-head race between Lawrence Hogan Jr., the son and namesake of the popular Prince George's County executive, and Bowie Mayor Audrey Scott.

On the Democratic side, the major candidates are Conroy, Council member Sue V. Mills, former Senate President Steny Hoyer and Spellman's 71-year-old husband Reuben. Two other candidates -- State Sen. Thomas P. O'Reilly and Del. Stewart Bainum -- are given less of a chance but are considered important factors because they may pull some votes from the stronger candidates.

For two weeks, since the U.S. Congress officially vacated Spellman's seat because of her continuing semicomatose state (she was striken with cardiac arrest Oct. 31), these candidates and others less known have hustled their way into headlines, talked to money people and political friends and tested the reaction to their various candidacies.

Although state law allows any of the candidates to remove their names from the ballot and get a full refund on the $100 filing fee if they withdraw before Wednesday, yesterday the official countdown for this compressed, three-week race began when the filing books closed.

For each candidate the filing deadline meant the beginning of mornings at Metro stations, days at shopping centers and evenings at kaffeeklatsches and candidates nights. "You're looking at planning, strategizing and implementing what is normally the last month of a campaign all at the same time," said Scott campaign manager Stu Piper. "You're looking at a very intense time."

In addition to the candidates named above, the following Democrats filed for their party's primary (listed in the order in which they filed): Michael I. Sprague of Greenbelt, John Eugene Sellner of Fort Washington, Robert B. Bates of Hyattsville, Anselmo Arturo Chavez of Gaithersburg, Robert Gali Basette of Saverna Park, William J. Halterman of Takoma Park, Donald Greenawalt of Largo, Richard E. Lee of College Park, Lawrence E. Keval of Bowie, Francis W. White of Largo, Joe Meadow of College Park and Henri DeLozier of Chevy Chase.

Republicans not named above who have filed are: George W. Benns of Silver Spring, Jon William Robinson of Seabrook, Jack Price, a pauper of Baltimore, Robert Byron Brickell of Bethesda, Woodworth A. Watrous of Rockville, David E. Elliott of Adelphi, Irvin H. Henson, Jr. of Baltimore, Frederick E. Taylor of District Heights and Jean Speicher of Laurel.

The independent who filed for the general election is Christos Poppos of Hyattsville.