You need forty quarters -- ten years. Self employed people pay into the system. Everyone who wants Part B pays something per month.
Self employed people pay in some cases, but as a business owner, there were many times when I did not pay myself a "salary". As a c corporation, which I have been for 20 odd years now, any "profit" is income to me, but not a type of income which counts as medicare quarters. In today's gig economy, a lot of people are like me- they have LLCs or Corporations, and income is treated differently.
I quit my last day job in 1978. Over the years since then, I have had well over 100 employees, 1 or 2 at a time, and I paid half of THEIR medicare and SS, but not enough of my own. Oh well.
The argentine system, where you just walk into a public hospital, and get treated, is more inclusive. I had a friend, an expat, who broke his shoulder in a fall- he went to the hospital on Cordoba, and had extensive treatment, a day or two in the hospital, and months of follow up- 100% free. no bribes, no under the table payments. The EMTs picked him up, and he got treated. Not the case in the USA. My kid once broke his arm, when I had Blue Cross- $3000 out of pocket, in Washington State.