You need to add a calculated field in which you add the variables male and female.
${male} + ${female}
You can then recall the value in the total field by using the "${}" operator.
E.g. If you call the new variable "sum", you would then then type ${sum} in the label field.
I would add to @Andrea_Martin's correct response that if any of your fields are non-mandatory/optional (ie may be empty) that you must explicitly treat blank values a 0, otherwise your total calculation will result in 'NaN' (literally, "not-a-number"...). See https://docs.opendatakit.org/form-logic/#empty-values-in-math for details.