The following source code alerts the following results:
Internet Explorer 7: 29
Firefox 3.0.3: 37 (correct)
Safari
Why not just try walking the DOM and see what each browser thinks that the document contains?
IE does a lot of "optimization" of the DOM. To get an impression of what this might look like, "Select all", "Copy" in IE, and then "Paste Alternate" in Visual Studio, You get the following:
So it nukes some of the empty tags and adds some default attributes.