NSF by itself contributes $200-300M a year towards math grants. Universities spend a billion+. Add corporate funding and other sources (DoD, other government agencies, private foundations) and you’re easily looking at a few billion dollars a year just in the US going to mathematicians.