Let
\[
S = \{(m,n) : m,n \in \{1,2,3,\ldots,50\}\}.
\]
If the number of elements \((m,n)\) in \(S\) such that \(6^m + 9^n\) is a multiple of \(5\) is \(p\), and the number of elements \((m,n)\) in \(S\) such that \(m+n\) is a square of a prime number is \(q\), then \(p + q\) is equal to