The former, I believe.Is it based on purely number of units, or is there something involved with how costly or advanced a unit is?
In my experience, it makes no difference what the unit is, be it a Pikeman, Paratrooper, Worker or Great General; they all add to your unit maintenance at the same rate. Here's where it gets weird, though... there appears to be a sort of "buy one, get one free" system going here. Every odd numbered unit is free. Your first unit does not require maintenance, nor your third, fifth, seventh and so on...