USAMO
1986
By a partition $\pi$ of an integer $n\ge 1$, we mean here a representation of $n$ as a sum of one or more positive integers where the summands must be put in nondecreasing order. (E.g., if $n=4$, then the partitions $\pi$ are $1+1+1+1$, $1+1+2$, $1+3, 2+2$, and $4$).
For any partition $\pi$, define $A(\pi)$ to be the number of $1$'s which appear in $\pi$, and define $B(\pi)$ to be the number of distinct integers which appear in $\pi$. (E.g., if $n=13$ and $\pi$ is the partition $1+1+2+2+2+5$, then $A(\pi)=2$ and $B(\pi) = 3$).
Prove that, for any fixed $n$, the sum of $A(\pi)$ over all partitions of $\pi$ of $n$ is equal to the sum of $B(\pi)$ over all partitions of $\pi$ of $n$.