Copy this formula into Sheet2!BS2 and copy down:

=SUMPRODUCT((Sheet1!A2:P2+1=Sheet1!B2:Q2)*(Sheet1!A2:P2<>""))