  We evaluate the topologically twisted index of a general four-dimensional
$\mathcal{N} = 1$ gauge theory in the "high-temperature" limit. The index is
the partition function for $\mathcal{N} = 1$ theories on $S^2 \times T^2$, with
a partial topological twist along $S^2$, in the presence of background magnetic
fluxes and fugacities for the global symmetries. We show that the logarithm of
the index is proportional to the conformal anomaly coefficient of the
two-dimensional $\mathcal{N} = (0,2)$ SCFTs obtained from the compactification
on $S^2$. We also present a universal formula for extracting the index from the
four-dimensional conformal anomaly coefficient and its derivatives. We give
examples based on theories whose holographic duals are black strings in type
IIB backgrounds AdS$_5 \times \text{SE}_5$, where SE$_5$ are five-dimensional
Sasaki-Einstein spaces.
