- int material = 67 * (pos.count<PAWN>(stm) - pos.count<PAWN>(~stm))
- + 395 * (pos.count<KNIGHT>(stm) - pos.count<KNIGHT>(~stm))
- + 288 * (pos.count<BISHOP>(stm) - pos.count<BISHOP>(~stm))
- + 630 * (pos.count<ROOK>(stm) - pos.count<ROOK>(~stm))
- + 857 * (pos.count<QUEEN>(stm) - pos.count<QUEEN>(~stm));
+ int material = pos.non_pawn_material(stm) - pos.non_pawn_material(~stm)
+ + 126 * (pos.count<PAWN>(stm) - pos.count<PAWN>(~stm));