Hungary has become the first communist country to officially embrace one of the most enduring symbols of a consumer society - the craze for blue jeans.

For years Hungarians, like their counterparts elsewhere in Eastern Europe, have been prepared to go to enormous lengths to acquire a pair of shrinkable, fadable, American jeans. Smuggled into the country illegally or bought literally off the bottoms of foreign tourists sightseeing Budapest, a pair of Levis could fetch up to $150 on the black market.

But beginning in June, amid growing public excitement fed by unprecedented publicity in the official press, Hungary is to start producing its own high-quality jeans under license from the U.S. San Francisco-based firm of Levi Strauss.

The contract, which was signed in Budapest last October following lengthy negotiations, marks the first major breakthrough by an American manufacturer into the potentially huge East European market for jeans. But it also reflects a significant turnaround in official communist attitudes toward an item of clothing that was once equated with political opposition or an unhealthy admiration for the West.

Demand for jeans had reached such a pitch in Hungary that a Budapest newspaper recently observed, in an article titled "The Tribulations of Blue Jeans," that the population can be divided into two groups: "Those who are wearing jeans - and those who are not, but would like to."

The May 1 Clothing Factory, the firm which is producing the Levis, has already been inundated with letters from Hungarians stating, with their leg and waist measurements and reserving an early paid of jeans. "I don't mind what they cost, just send me the pants" is the theme of most of the letters.

In fact they will cost around 50 U.S. dollars.

A glance back at the rise of jeans in Hungary provides some interesting insights into how Hungarian society itself has changed over the last 20 years. At first jeans were frowned on as a capitalist fad. Then Hungarian manufacturers tried to copy them with their own brands and now, finally, they are using Western methods to achieve a product as close as possible to the American original.

It is hardly a coincidence that the same period has seen a steady liberalization in the Hungarian economy.With its elegant department stores and bustling sidewalks, Budapest has been described as "Communism's Shop Window."

At one time the wearing of jeans, together with long hair, was widely regarded as a political symbol.

"Hungarian bureaucrats are usually overfed and couldn't squeeze into a pair of jeans even if they wanted to," said a former student. "But we could wear them and look elegant and rebellious at the same time."

In police raids in the late '50s and early '60s, youths wearing jeans and long hair were always the first to be picked up.

Gradually, however, the political symbolism of jeans gave way to the economic. Jeans became a sign of status rather than protest. As a writer in a Hungarian literary weekly complained last year: "It is ridiculous that a piece of clothing, cheap and fundamentally democratic elsewhere, has become a luxury article and class symbol in our country."

But although many Hungarian firms, including the May 1 Clothing Factory, began producing their own jeans, Western brands remained much more popular with the consumer.

Although cheaper, the domestic jeans were of inferior quality. The cut was poor and they lacked the two characteristics of Levis most attractive to young Hungarians: They didn't shrink to produce a tight fit and they didn't fade.

Nowadays hundreds of thousands of pairs of Western jeans are smuggled into Hungary every year by way of Austria and Yugoslavia.

The popularity of Western jeans also provides plenty of opportunity for old-fashioned private enterprise. A prominent Hungarian sportsman described how, on a foreign tour, he bought three pair of jeans in Holland. He sold two pairs in the Soviet Union, earning enough money to buy a portable TV set. The third pair he sold on his return to Budapest, recouping his original investment.

It was the large scale smuggling, coupled with the high prices which Western jeans were fetching on the black market, that encouraged the May 1 Clothing Factory to approach Levi Strauss. Under the agreement, the factory will produce nearly, a million pairs of Levis a year - 66 percent of which will be repurchased by the U.S. firm.

Over the last six months, Hungarian workers have been learning how to make American jeans - with some interesting results. A party of eight workers who spent three weeks at the Levi Strauss factory at Warsaw, Va., returned full of admiration for American efficiency and determined to adopt similar working methods.

"What most impressed us was the tempo of work. At first we could hardly get over our amazement at seeing how the Americans managed to work in such a disciplined way through a whole shift," remarked Sandor Horvath, a cutter, in an interview with a Hungarian newspaper.

Commented another member of the delegation: "When we returned home we were amazed to see how slow work is in our factory. If we wish to remain competitive, we must give up our leisurely ways."

With new machinery provided by Levi Strauss, labor productivity at the May 1 factory is expected to increase considerably. Production of a pair of jeans will be cut from around 60 minutes to 24 minutes and wages are planned to rise by an average of 25 percent.

It is not entirely fanciful to suggest that the sale of the first Hungarian-produced Levis in Budapest shops next month will mark the beginning of a new era in Eastern Europe. A Budapest University lectuter sees the interest of young people in Western fashions as symbolic of a more general yearning for a Western-style democracy.

Looking comfortably chic in a pair of imported denims, he added: "The problem is that it can also be a surrogate. We get the blue jeans - and we forget about the open society."