Split each floor of the flats into a manageable block of units.
Use single pair of wires looping to each block of units (i.e. 12 units). Each switch is normally closed and has a resistor across its terminals.
Flat 1 has a 500R resistor, Flat 2 has a 1k resistor, Flat 3 has a 2k resistor, Flat 4 has a 4k resistor, Flat 5 has a 8k resistor.
Measure the resistance or use an A2D port on a PIC microcontroller.
If 8.5k is measured you know Flat 5 and Flat 1 have pressed their buttons
If 3k is measured then flat 3 and flat 2 have pressed their buttons
If 15.5k is measured then all flats have pressed their buttons and there is probably a fire somewhere.