Let $X=\mbox{Spec}A$ and $Y=\mbox{Spec}B$ be two affine schemes such that $A$ and $B$ are domains and finitely generated as $\mathbb{Z}$-algebras, and contain $\mathbb{Z}$. Consider their product over $\mathbb{Z}$: $X\times_\mathbb{Z} Y=\mbox{Spec}(A\otimes_\mathbb{Z}B)$. I want to show that $\mbox{dim}X\times_\mathbb{Z}Y=\mbox{dim}X+\mbox{dim}Y-\mbox{dim}\mathbb{Z}=\mbox{dim}X+\mbox{dim}Y-1$.
Now, this is obviously the case when $A=\mathbb{Z}[x_1,\ldots,x_m]$ and $B=\mathbb{Z}[y_1,\ldots,y_n]$, since in this case $A\otimes B=\mathbb{Z}[x_1,\ldots,x_m,y_1,\ldots,y_n]$, and has dimension $m+n+1=(m+1)+(n+1)-1$.
In the general case, we have that $A=\mathbb{Z}[t_1,\ldots,t_m]$ and $B=\mathbb{Z}[s_1,\ldots,s_n]$, where the $t_i$'s and $s_i$'s satisfy certain relations. Moreover we see that $A\otimes B=\mathbb{Z}[t_1,\ldots,t_m,s_1,\ldots,s_n]$.
I can't seem to figure out how to find the dimension of this ring based on the dimensions of $A$ and $B$; am I missing some trivial observation?