-- Database schema
| course : course_id [ INTEGER ] primary_key , name [ TEXT ] , credit [ INTEGER ] , diff [ INTEGER ] | prof : prof_id [ INTEGER ] primary_key , gender [ TEXT ] , first_name [ TEXT ] , last_name [ TEXT ] , email [ TEXT ] , popularity [ INTEGER ] , teachingability [ INTEGER ] , graduate_from [ TEXT ] | RA : student_id [ INTEGER ] RA.student_id = student.student_id , capability [ INTEGER ] , prof_id [ INTEGER ] RA.prof_id = prof.prof_id , salary [ TEXT ] | registration : course_id [ INTEGER ] registration.course_id = course.course_id , student_id [ INTEGER ] registration.student_id = student.student_id , grade [ TEXT ] , sat [ INTEGER ] | student : student_id [ INTEGER ] primary_key , f_name [ TEXT ] , l_name [ TEXT ] , phone_number [ TEXT ] , email [ TEXT ] , intelligence [ INTEGER ] , gpa [ REAL ] , type [ TEXT ] |
-- -- What is the popularity of the professor who advises the highest number of students with the highest research ability?

SELECT T2.popularity FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id, T1.capability ORDER BY COUNT(T1.student_id) DESC, T1.capability DESC LIMIT 1;