@Primotivo,
It depends. Does it have to work out evenly - so that there are no mega-fly legs left over or wasted? If that's not a requirement - you could catch how ever many you wanted - as long as you had 44 males say and 1 female - which would give you 140 legs or you could have 36 males and 4 females and that would give you 140 legs, 28 males and seven females, 2o males/10 females, 12 males/13 females, 4 males/16 females ... etc. think about it in terms of multiples of 3 and 8 .
Oh, see I'm a teacher so I gave him the answers hoping that would help him figure out how to do the problem....