Complete reaction of acetaldehyde with excess formaldehyde, upon heating with conc. NaOH solution, gives P and Q. Compound P does not give Tollens' test, whereas Q on acidification gives positive Tollens' test. Treatment of P with excess cyclohexanone in the presence of catalytic amount of p-toluenesulfonic acid (PTSA) gives product R. Sum of the number of methylene groups (-CH2-) and oxygen atoms in R is _______