I think your idea is right, but you don't think about it. What you subtract is the situation that girls sit at the head and tail, but the title means "Girls don't sit at the head and tail". Should we also subtract the situation that there are sisters in the head and no sisters in the tail?