Genus-degree formula