3. Given that Figure 1 is the graph of an even function $f(x)$, and Figure 2 is the graph of an odd function $g(x)$.
Let the number of real roots of the equations $f(f(x))=0, f(g(x))=0$,
$$
g(g(x))=0, g(f(x))=0
$$

be $a, b, c, d$ respectively. Then
$$
a+b+c+d=
$$
$\qquad$
3. 30 .

From the graph, we know that the range of the function $y=f(x)$ is $[-1,1]$, and the range of $y=g(x)$ is $[-2,2]$.

Notice that, the roots of the equation $f(x)=0$ are $0, x_{1}, x_{2}$, with $\left|x_{1}\right|=\left|x_{2}\right| \in(1,2)$;

The roots of the equation $g(x)=0$ are $0, x_{3}, x_{4}$, with $\left|x_{3}\right|=\left|x_{4}\right| \in(0,1)$.

Therefore, the roots of the equation $f(f(x))=0$ are the roots of the equations $f(x)=0$ or $f(x)=x_{1}$ or $f(x)=x_{2}$.

Since the range of the function $y=f(x)$ is $[-1,1]$, and $\left|x_{1}\right|=\left|x_{2}\right| \in(1,2)$, the equations $f(x)=x_{1}$ and $f(x)=x_{2}$ have no roots, while the equation $f(x)=0$ has three roots. Thus, the number of roots of the equation $f(f(x))=0$ is 3.

The roots of the equation $f(g(x))=0$ are the roots of the equations $g(x)=0$ or $g(x)=x_{1}$ or $g(x)=x_{2}$.

Since the range of the function $y=g(x)$ is $[-2,2]$, and $\left|x_{1}\right|=\left|x_{2}\right| \in(1,2)$, the equations $g(x)=x_{1}$ and $g(x)=x_{2}$ each have three roots, and the equation $g(x)=0$ also has three roots. Thus, the number of roots of the equation $f(g(x))=0$ is 9.

Similarly, the equations $g(g(x))=0$ and $g(f(x))=0$ each have 9 roots.
Therefore, $a+b+c+d=3+9+9+9=30$.