human
Considering the provided database schema and associated query, produce SQL code to retrieve the answer to the query. 
###Database Schema: Province, Membership, Population, % LDS, Branches, Total Congregations
###Question: What's the sum of population when the membership is 51,439 for fewer than 40 branches?
gpt
SELECT SUM Population FROM table WHERE Membership = 51,439 AND Branches < 40