Three numbers p, q and r are pairwise coprime. If the product of p and q is 629 and that of q and r is 391, then find the value of (p + 2q + r).