A universal formula for counting cubic surfaces