nate at 538 says that there are 972 ways to count the popular vote in the democratic primary race. but really there's only one: fiddle with the factors until you can find a way to have the candidate you like the most ahead. then insist that's the only sensible way to count the vote.
but if want to fiddle, click on the above link for a handy fiddling tool. (NOTE: it's basically an embedded excel spreadsheet. to make it work, don't just click on the square you want, manually type in the "x" and then erase the "x" in the blank you don't want. it seems to work pretty well if you do it like that)