write total number of lessons for a course on join