dimension of orthogonal complement

We know that if $U$ is a subspace of $V$ (finite-dimensional), then $V = U oplus U^perp$. Given this theorem, how does this lead to the conclusion that $dim U^perp = dim V – dim U$? This seems like a stupid question because it seems obvious, but I’m still unclear with this notion of a direct sum and the dimensions of subspaces adding up to the vector space.