Optimally Mitigating Backdoor Attacks in Federated Learning