In order to solve, you need to set up an equation
x represents the number of males
x + 77 represents the number of females
therefore,
x + x + 77 = 785
solve to get the value of x, which represents the males
then add 77 to that number to get the amount of females
These two numbers when added together will give you 785, the total amount of students in this class.