Constraining the number of fundamental quantum degrees of freedom using gravity