In right triangle A B C with the right angle at C, \angle B A C<45^{\circ} and A B= 4. Point P on \overline{A B} has the properties that \angle A P C=2 \angle A C P and C P=1. The ratio \frac{A P}{B P} can be represented in the form p+q \sqrt{r}, where p, q and r are positive integers and r is not divisible by the square of any prime. Find p+q+r.