The idea is to have fewer programs ultimately. Medicare and Medicaid would either be folded into a universal health care program combined with a smaller UBI dollar amount, or they would be scrapped entirely with a UBI that was high enough to let people buy private health care. If cost is your concern, the first approach would be cheaper.
If the UBI was higher than Social Security, you could just scrap that too. If it was lower, you’d probably have to phase it out.