The immune system has 1.8 trillion cells which puts it between total brain cells (57 billion) and total synapses (150 trillion); and contains its own complex processes and interactions.
I’m not immediately convinced the brain is more complicated, based on raw numbers.