typedef struct CSNode {
int val;
CSNode *firstchild, *nextsibling;
} CSNode, *CSTree;
int dfs(CSTree root) {
if (!root) return 0;
else if (!root->firstchild) return 1;
else {
int left = dfs(root->firstchild);
int right = dfs(root->nextsibling);
return left + right;
}
}