Jack earned from the brownies $3 per brownie * 4 brownies = $<<3*4=12>>12.
Jack earned from the lemon squares $2 per square * 5 squares = $<<2*5=10>>10.
He still needs to earn $50 - $12 - $10 = $<<50-12-10=28>>28.
He sells cookies for $4 each, so Jack still needs to sell $28 / $4 = <<28/4=7>>7 cookies.
#### 7