A Sample Complexity Measure with Applications to Learning Optimal Auctions