Quantifying gerrymandering using the vote distribution