For a graph G, the graph cubeahedron square(G) and the graph associahedron Delta(G) are simple convex polytopes which admit (real) toric manifolds. In this paper, we introduce a graph invariant, called the b-number, and show that the b-numbers compute the Betti numbers of the real toric manifold X-R(square(G)) corresponding to square(G). The b-number is a counterpart of the notion of a-number, introduced by S. Choi and the second named author, which computes the Betti numbers of the real toric manifold X-R(Delta(G)) corresponding to Delta(G). We also study various relationships between a-numbers and b-numbers from the viewpoint of toric topology. Interestingly, for a forest G and its line graph L(G), the real toric manifolds X-R(Delta(G)) and X-R(square(L(G))) have the same Betti numbers.