Yes, with a program for computing chromatic polynomials I went a bit far, didn't I?



There are 4 choices for H and 3 choices for G.



(a) E = F; then there are 2 choices for E = F.

(a1) C = D; then there are 2 choices for C = D, 2 choices for B and 2 for A. Total for (a), (a1): 12 * 2^4.

(a2) C ≠ D; then there are 2 choices for C, 2 for D, 1 for B and 1 for A. Total for (a), (a2): 12 * 2^3.



(b) E ≠ F; then there are 2 choices for E and 2 for F.

(b1) C = D; them there is 1 choice for C, 1 for D, 2 for B and 2 for A. Total for (b), (b1): 12 * 2^4.

(b2) C ≠ D; then there is 1 choice for C, 2 for D, 1 for B and 1 for A. Total for (b), (b2): 12 * 2^3.



Total: 12 * 2 * (2^4 + 2^3) = 576.



Maybe it can be shortened a bit...