Lets say its the $x$th day. Then, Greg is alone if and only if $x$ is a multiple of $5$ but not of $3$ or $7$. Dividing 365 by $5$ we get that Greg will go to the park 73 times.
Joe will go to the park every 3 times that Greg goes to the park. 73 = 24*3 + 1, so will be 24 occasions in which Joe is also in the park. Also, as 73 = 10*7 + 3, there will be 10 occasions when Dean is also in the park. Finally they are all in the park if $x$ is a multiple of $3*5*7=105$, which is only on 3 days. Thus, tallying it all up Greg is alone 73 - 24 - 10 + 3 = 42 days out of the year (the reason I add 3 is because in subtracting 24 and 10 I have also included days when they are both there twice, but we are only counting how many days he is alone).
Similarly, Dean will meet Joe if and only if $x$ is both a multiple of 3 and 7, or if and only if $x$ is a multiple of 21. As $365 = 17*21 + 8$, they will meet on $17$ occasions.
Basically to attack these problems just think about dividing the 365 days and using the quotient, as it is equal to the number of days a given person goes to the park.