The out-degree of each vertex will be the number of vertices in its adjacency list. So, for all the vertices, we can get the out-degree in $\Theta(m+n)$ time where $m$ is the number of edges. Since $ m = \Theta(n^2),$ this will give $\Theta(n^2).$
In-degree can also be computed in $\Theta(m+n)$ time by maintaining an array of size $n$ for the vertices and then traversing all the adjacency lists. Whenever we encounter a vertex we increment the corresponding entry in the array.
Thus, we get $a = c = 2, b = d = 0.$
$2\times a + 3 \times b + 5 \times c + 7 \times d = 14.$