If the United States wants to boost its productivity, the country should give more visas to skilled workers and reform entitlement programs, former Federal Reserve Chairman Alan Greenspan said Thursday. Expanding the H-1B visa program, which helps special- or high-skill workers who graduate from college in the United States, would be a crucial first step, said Greenspan.

“Every other major country looks to the quality of whom they’re inviting in, and we're not doing that. We‘re restricting that very significantly,” he said during a discussion hosted by the Council on Foreign Relations in New York City with Steve Liesman, a senior economics reporter for CNBC. “I mean, if you really want to increase productivity, we would really open that program up. And anyone who got a Ph.D. in the physical sciences in the United States would be allowed to stay. Instead, we kick them out. Why we do this is bizarre and beyond me."

Greenspan’s talk came one day after the Federal Reserve announced it would raise interest rates for the first time in nearly a decade. The Fed pushed the federal funds rate up a quarter of a percentage point from the near-zero levels where it had been, and Greenspan said the markets generally reacted positively because economists had been expecting the U.S. central bank to raise rates for some time.

“The only question that was out there was what was going to happen substantively,” Greenspan said. “As it became apparent that the Fed was going to just raise the rates and not do a whole series of rates ... the uncertainty was gone.”

He added that when he was Fed chairman, he also had to navigate whether to surprise the markets with rate increases or give some notice on what he was doing. Greenspan, who served as chairman of the Fed from 1987 to 2006, was originally seen as a “rock star” economist, but has more recently been blamed for building up the housing bubble that led to the financial crisis after his term.

Greenspan focused on U.S. monetary policy and productivity during his Thursday talk, emphasizing that the country’s spending on entitlement programs is out of control. He said he has a generally pessimistic view of the U.S. economy over the next decade if lawmakers do not find a way to “come to grips” with entitlements such as Social Security and Medicare.

“But entitlements are basically the third rail of American politics. You touch it as you’re running for office and you lose,” Greenspan said.

The only ways the U.S. could get out of its current slow economic cycle, Greenspan said, would be either to increase national output per hour or to increase hours worked through immigration policies such as the H-1B visa program. He has called on the U.S. to let in skilled immigrants before, and has even said that illegal immigration contributes to economic growth by providing a flexible workforce. Roughly 233,000 foreigners applied for only 85,000 H-1B visas this year.

When asked about the 2016 presidential campaign’s focus on immigration and visa programs, Greenspan joked, “What makes you think I listen to it?”