Use cells to hold the criteria.

A1 = 1
B1 = Free

=SUMPRODUCT(--(LEFT(AC2:AC6909)=A1&""),--(Range=B1))