From Weighted to Unweighted Model Counting