Define = max strings selectable using at most zeros and ones. Your answer is . For each string with zeros and ones, the formula is: .
Process each string and update the 2D (two-dimensional) DP array backwards (from down to , from down to ) to avoid reusing the same string. It's the same backwards-loop trick from 0/1 knapsack, just in two dimensions.