suppose there are x boys ans y girls
no. of handshakes between the boys= xC2= x!/2!.(x-2)! = x(x-1)/2
similarly no. of handshakes between girls = y(y-1)/2
according 2 the ques.
x(x-1)/2 + y(y-1)/2 = 27
x(x-1) + y(y-1)=54
here the only possible positive integer solution is 7 and 4 i.e if x is 7 y is 4 and inverse
since in the ques. no of boys is given more so there are 7 boys in the party