;;At least 3 white passed pawns and at least two black passed pawns in the same position
(match :pgn mega.pgn :output out.pgn
(position
:sumrange whitecount 3 8
:sumrange blackcount 2 8
:markall
:and
((position
Pd2
:piececount [pP][d3-7] 0
:piececount p[c3-7,e3-7] 0
:shift
:accumulate whitecount
)
(position
pd7
:piececount [pP][d2-6] 0
:piececount P[c2-6,e2-6] 0
:shift
:accumulate blackcount
)
)
)
)