for this type of problem first try to convert expression into nand logic.
f= (x' + y')(z+w)
= (xy)'(z+w) ----- here (x' + y') is now converted into NAND logic (xy)'
now sppose A = (xy)'
f= A(z+w)
=Az+Aw ----- it is a sop expression requires 2 level and- or circuit or 2-level NAND-NAND circuit.
u can also convert this into NAND logic
f=((Az)'(Aw)')' ---- this expression shows require 3 NAND gate 1 for (Az)' 2nd for (Aw)' and 3rd for ((Az)'(Aw)')'
and before this 1 NAND gate also reqire for A=(xy)'
so total no of NAND gates = 4
--------- hope u ll get it in a proper way after this explanation....